Skip to content

Commit

Permalink
Handle test-cli failure case for CI (#19265)
Browse files Browse the repository at this point in the history
  • Loading branch information
trueadm committed Jul 6, 2020
1 parent 0f84b0f commit 0c0aaeb
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion scripts/jest/jest-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();

0 comments on commit 0c0aaeb

Please sign in to comment.