0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -05:00

Exit code 1 if node:test fail (#9928)

This commit is contained in:
Bjorn Lu 2024-02-01 23:47:13 +08:00 committed by GitHub
parent 27ea080e24
commit 432c170554
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -62,6 +62,11 @@ export default async function test() {
setup: args['--setup'],
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);