Skip to content

Commit 5145f79

Browse files
unknownclaude
andcommitted
Fix CI: use shell-safe test commands in test-runner tests
Replace `node --eval process.exit(0)` with `node --version` (pass) and `node --require ./nonexistent-module.js` (fail) to avoid parentheses being interpreted by bash on Linux CI. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 0c6cfff commit 5145f79

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/scoring/test-runner.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,14 @@ describe("runTests", () => {
9696
});
9797

9898
it("returns success for passing command", async () => {
99-
const result = await runTests(1, "node --eval process.exit(0)", ".");
99+
const result = await runTests(1, "node --version", ".");
100100
assert.equal(result.passed, true);
101101
assert.equal(result.exitCode, 0);
102102
});
103103

104104
it("returns failure for failing command", async () => {
105-
const result = await runTests(1, "node --eval process.exit(1)", ".");
105+
// --require a non-existent module to trigger a guaranteed non-zero exit
106+
const result = await runTests(1, "node --require ./nonexistent-module.js", ".");
106107
assert.equal(result.passed, false);
107108
assert.ok(result.exitCode !== 0);
108109
});

0 commit comments

Comments
 (0)