test(cli): consolidate malformed setup dry-run coverage (#12790)

test(setup): consolidate malformed dry-run CLI coverage
This commit is contained in:
morluto authored and GitHub committed 2026-11-20 12:39:10 +00:00
1 parent 337fd43a0f
commit 6bc96f3f99
1 file changed
+3 -18
+3 -18
View File
@@ -140,7 +140,9 @@ cliTest.for([
await expect(access(config)).rejects.toMatchObject({ code: "ENOENT" });
expect(result.exitCode).not.toBe(0);
expect(`${result.stdout}\n${result.stderr}`).toContain("--dry-run");
expect(result.json).toMatchObject({ code: "PARSE_ERROR" });
expect(result.stdout).toContain("--dry-run");
expect(`${result.stdout}\n${result.stderr}`).not.toMatch(/^ +at /mu);
},
);
@@ -162,23 +164,6 @@ cliTest.for(["--dry-run=true", "--dry-run=false"] as const)(
},
);
cliTest(
"reports invalid dry-run through the public CLI without a stack trace",
async ({ cli }) => {
const home = await createTestTempDirectory(
"rea-cli-public-invalid-dry-run-",
);
const config = join(home, ".codex", "config.toml");
const result = await runSetup(cli, home, "--dry-run=abc");
expect(result.exitCode).not.toBe(0);
expect(result.json).toMatchObject({ code: "PARSE_ERROR" });
expect(result.stdout).toContain("--dry-run");
expect(`${result.stdout}\n${result.stderr}`).not.toMatch(/^ +at /mu);
await expect(access(config)).rejects.toMatchObject({ code: "ENOENT" });
},
);
cliTest(
"shows setup help even when a malformed dry-run value is present",
async ({ cli }) => {