Make process fail when mocha fails on integration tests.

pull/330/head
Clement Michaud 2019-02-24 14:05:11 +01:00
parent ecdc91b221
commit c258c25a38
1 changed files with 7 additions and 0 deletions

View File

@ -50,3 +50,10 @@ mocha.stdout.on('data', (data) => {
mocha.stderr.on('data', (data) => { mocha.stderr.on('data', (data) => {
process.stderr.write(`${data}`); process.stderr.write(`${data}`);
}); });
mocha.on('exit', function(statusCode) {
if (statusCode != 0) {
console.error("The tests failed... Mocha exited with status code " + statusCode);
}
process.exit(statusCode);
})