diff --git a/lib/runnable.js b/lib/runnable.js index a899e860a1..d0f3aebf18 100644 --- a/lib/runnable.js +++ b/lib/runnable.js @@ -350,13 +350,16 @@ Runnable.prototype.run = function(fn) { throw new Pending('async skip; aborting execution'); }; - if (this.allowUncaught) { - return callFnAsync(this.fn); - } try { callFnAsync(this.fn); } catch (err) { + // handles async runnables which actually run synchronously emitted = true; + if (err instanceof Pending) { + return; // done() is already called in this.skip() + } else if (this.allowUncaught) { + throw err; + } done(Runnable.toValueOrError(err)); } return; diff --git a/lib/runner.js b/lib/runner.js index 3afe9e205e..ca447f139b 100644 --- a/lib/runner.js +++ b/lib/runner.js @@ -914,8 +914,9 @@ Runner.prototype.run = function(fn) { process.removeListener('uncaughtException', uncaught); process.on('uncaughtException', function(err) { if (err instanceof Pending) { - // return; eslint error + return; } + throw err; }); fn(self.failures); });