验证样例文章验收冒烟流程

This commit is contained in:
czj
2026-07-01 15:12:13 +08:00
parent 762380c937
commit 66fee182f5
3 changed files with 27 additions and 4 deletions
+14
View File
@@ -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");
});
});