Handle test-cli failure case for CI (#19265)

This commit is contained in:
Dominic Gannaway
2020-07-06 22:05:51 +01:00
committed by GitHub
parent 0f84b0f02b
commit 0c0aaeb6bc
+11 -1
View File
@@ -317,7 +317,17 @@ function main() {
}
// Run Jest.
spawn('node', args, {stdio: 'inherit', env: {...envars, ...process.env}});
const jest = spawn('node', args, {
stdio: 'inherit',
env: {...envars, ...process.env},
});
// Ensure we close our process when we get a failure case.
jest.on('close', code => {
// Forward the exit code from the Jest process.
if (code === 1) {
process.exit(1);
}
});
}
main();