Skip to content

Commit

Permalink
add event handler for Node v8
Browse files Browse the repository at this point in the history
  • Loading branch information
juergba committed Sep 17, 2019
1 parent 8c68fe5 commit 8dbfb73
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -917,6 +917,11 @@ Runner.prototype.run = function(fn) {
this.on(constants.EVENT_RUN_END, function() {
debug(constants.EVENT_RUN_END);
process.removeListener('uncaughtException', uncaught);
process.on('uncaughtException', function(err) {
// TODO: remove this listener when Node v8 support is dropped
process.exitCode = 1;
console.error('\n', err);
});
fn(self.failures);
});

Expand Down

0 comments on commit 8dbfb73

Please sign in to comment.