Skip to content

Commit

Permalink
Exit with code 255 if more errors than 255 were returned. Fixes #2438
Browse files Browse the repository at this point in the history
  • Loading branch information
Munter committed Aug 23, 2016
1 parent 7509752 commit 047455b
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, 255)) })
}

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, 255));
}

var draining = 0;
Expand Down

0 comments on commit 047455b

Please sign in to comment.