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 + } }