fix: triage E2E runs both test files in subprocesses

math.test.js called process.exit(1) which killed the runner before
string.test.js could execute. Changed test runner to use child_process
so each test runs independently and both failure classes are exercised.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Garry Tan
2026-03-21 09:56:01 -07:00
parent bd1d591007
commit 301a12940a
+12 -3
View File
@@ -2982,10 +2982,19 @@ try {
}
`);
// Test runner
// Test runner — each test in a subprocess so one failure doesn't kill the other
fs.writeFileSync(path.join(triageDir, 'test', 'run.js'), `
require('./math.test.js');
require('./string.test.js');
const { execSync } = require('child_process');
const path = require('path');
let failures = 0;
for (const f of ['math.test.js', 'string.test.js']) {
try {
execSync('node ' + path.join(__dirname, f), { stdio: 'inherit' });
} catch (e) {
failures++;
}
}
if (failures > 0) process.exit(1);
`);
// Commit on main with the pre-existing bug