test(cli): allow cold-start integration timing

This commit is contained in:
morluto
2026-07-14 05:03:08 +00:00
parent 5279d7755c
commit 7d5621dfbc
2 changed files with 132 additions and 110 deletions
+17 -12
View File
@@ -17,6 +17,7 @@ import { PROCESS_PROVIDER } from "../src/application/ProcessEvidence.js";
const roots: string[] = [];
const execFileAsync = promisify(execFile);
const CLI_INTEGRATION_TIMEOUT_MS = 60_000;
afterEach(async () => {
await Promise.all(
@@ -31,18 +32,22 @@ const fixture = async (): Promise<string> => {
};
describe("process CLI errors", () => {
it("exits unsuccessfully without writing failure-shaped evidence", async () => {
await expect(
execFileAsync(
process.execPath,
["scripts/rea.mjs", "capture-process", "/missing/scenario.json"],
{ cwd: process.cwd() },
),
).rejects.toMatchObject({
code: 1,
stdout: expect.stringContaining("category: invalid_input"),
});
});
it(
"exits unsuccessfully without writing failure-shaped evidence",
async () => {
await expect(
execFileAsync(
process.execPath,
["scripts/rea.mjs", "capture-process", "/missing/scenario.json"],
{ cwd: process.cwd() },
),
).rejects.toMatchObject({
code: 1,
stdout: expect.stringContaining("category: invalid_input"),
});
},
CLI_INTEGRATION_TIMEOUT_MS,
);
it("projects unexpected causes without their message or stack", () => {
const projected = projectProcessCliError(