Skip to content

Commit

Permalink
Exit with code 1 if any errors were returned. Fixes #2438
Browse files Browse the repository at this point in the history
  • Loading branch information
Munter committed Aug 15, 2016
1 parent 7509752 commit 76b84f5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bin/_mocha
Original file line number Diff line number Diff line change
Expand Up @@ -405,15 +405,15 @@ if (program.watch) {
}

function exitLater(code) {
process.on('exit', function() { process.exit(code) })
process.on('exit', function() { process.exit(Math.min(code, 1)) })
}

function exit(code) {
// flush output for Node.js Windows pipe bug
// https://github.com/joyent/node/issues/6247 is just one bug example
// https://github.com/visionmedia/mocha/issues/333 has a good discussion
function done() {
if (!(draining--)) process.exit(code);
if (!(draining--)) process.exit(Math.min(code, 1));
}

var draining = 0;
Expand Down

0 comments on commit 76b84f5

Please sign in to comment.