diff --git a/lib/runner.js b/lib/runner.js index 1369960e03..980b3ccbbd 100644 --- a/lib/runner.js +++ b/lib/runner.js @@ -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 + console.error('\n', err); + process.exit(1); + }); fn(self.failures); });