Skip to content

Commit 924494a

Browse files
committed
test: replay quiet suite failures
1 parent 1567a9c commit 924494a

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

‎test/run-tests.cjs‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ function resolveTestFile(file) {
440440
async function runSuite(label, files) {
441441
const result = await runCommand(label, ['--test', '--test-concurrency=1', ...files.map(resolveTestFile)]);
442442
const stats = parseStats(result.stdout || '');
443-
return { ...stats, exitCode: result.exitCode };
443+
return { ...stats, ...result };
444444
}
445445

446446
// ─── Main ─────────────────────────────────────────────────────────────────────
@@ -496,7 +496,14 @@ async function main() {
496496
totalPass += stats.pass;
497497
totalFail += stats.fail;
498498
totalSkip += stats.skip;
499-
if (stats.exitCode !== 0 || stats.fail > 0) anyFailed = true;
499+
if (stats.exitCode !== 0 || stats.fail > 0) {
500+
anyFailed = true;
501+
if (QUIET) {
502+
console.error(`\n[tests] ${label} failed; replaying captured output:\n`);
503+
if (stats.stdout) process.stdout.write(stats.stdout);
504+
if (stats.stderr) process.stderr.write(stats.stderr);
505+
}
506+
}
500507
}
501508

502509
const total = totalPass + totalFail + totalSkip;

0 commit comments

Comments
 (0)