From 05b7466da3b69a68678b8f529f1bd65fe55df51b Mon Sep 17 00:00:00 2001 From: Kodama Date: Sat, 15 Aug 2026 23:50:53 -0500 Subject: [PATCH] fix: exit non-zero when tests fail `test` counts failed tests, prints the total, and returns 0 regardless, so any CI step running it reports success no matter how many sources are broken. Sets `process.exitCode` rather than calling `process.exit()`, so the summary and the `--output` report both flush before the process ends. --- packages/toolchain/src/commands/test/index.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/toolchain/src/commands/test/index.ts b/packages/toolchain/src/commands/test/index.ts index 50f9b37..3ef7057 100644 --- a/packages/toolchain/src/commands/test/index.ts +++ b/packages/toolchain/src/commands/test/index.ts @@ -171,4 +171,9 @@ export async function test( ) console.log(' Passed:', pc.green(passedTests)) console.log(' Failed:', pc.red(failedTests)) + + // Set rather than call process.exit(), so stdout and the --output file flush first. + if (failedTests > 0) { + process.exitCode = 1 + } }