验证样例文章验收冒烟流程
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import {
|
||||
baseURLForPort,
|
||||
parseEnvFile,
|
||||
preflight,
|
||||
redact,
|
||||
waitForServer,
|
||||
} from "../../scripts/run-geo-sample-e2e.mjs";
|
||||
|
||||
describe("run-geo-sample-e2e helpers", () => {
|
||||
@@ -34,6 +36,10 @@ EMPTY=
|
||||
).toThrow("DEEPSEEK_API_KEY is required for live sample E2E");
|
||||
});
|
||||
|
||||
it("uses localhost for Next dev URLs", () => {
|
||||
expect(baseURLForPort(3000)).toBe("http://localhost:3000");
|
||||
});
|
||||
|
||||
it("redacts configured secrets from logs", () => {
|
||||
expect(
|
||||
redact("x-api-key: local-dev-key provider secret", [
|
||||
@@ -42,4 +48,12 @@ EMPTY=
|
||||
]),
|
||||
).toBe("x-api-key: [REDACTED] [REDACTED]");
|
||||
});
|
||||
|
||||
it("fails fast when the dev server process exits before readiness", async () => {
|
||||
await expect(
|
||||
waitForServer("http://127.0.0.1:9", 1000, {
|
||||
exitCode: 1,
|
||||
}),
|
||||
).rejects.toThrow("dev server exited before http://127.0.0.1:9 became ready");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user