diff options
author | 2024-02-01 23:47:13 +0800 | |
---|---|---|
committer | 2024-02-01 23:47:13 +0800 | |
commit | 432c170554e031226814d867b75c175b5d0da47b (patch) | |
tree | c08976f3e7b0f4cc9d19d04a83f94acfeae91d06 /scripts/cmd/test.js | |
parent | 27ea080e24e2c5cdc59b63b1dfe0a83a0c696597 (diff) | |
download | astro-432c170554e031226814d867b75c175b5d0da47b.tar.gz astro-432c170554e031226814d867b75c175b5d0da47b.tar.zst astro-432c170554e031226814d867b75c175b5d0da47b.zip |
Exit code 1 if node:test fail (#9928)
Diffstat (limited to 'scripts/cmd/test.js')
-rw-r--r-- | scripts/cmd/test.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/scripts/cmd/test.js b/scripts/cmd/test.js index 4e3b6c6ca..396e4b721 100644 --- a/scripts/cmd/test.js +++ b/scripts/cmd/test.js @@ -63,6 +63,11 @@ export default async function test() { watch: args['--watch'], timeout: args['--timeout'] ?? defaultTimeout, // Node.js defaults to Infinity, so set better fallback }) + .on('test:fail', () => { + // For some reason, a test fail using the JS API does not set an exit code of 1, + // so we set it here manually + process.exitCode = 1; + }) .pipe(new spec()) .pipe(process.stdout); } |