Skip to content

armgit / mocha

Public Imported from GitHub
0

☕️ Classic, reliable, trusted test framework for Node.js and the browser

Fixed double reporting of uncaught exceptions after timeout. Closes #195

Tj Holowaychukd520a87a48d3
diff --git a/lib/runner.js b/lib/runner.js
index 3fef8825..6f2a705b 100644
--- a/lib/runner.js
+++ b/lib/runner.js
@@ -398,6 +398,7 @@ Runner.prototype.run = function(fn){
function uncaught(err){
var runnable = self.currentRunnable;
debug('uncaught exception');
+ if (runnable.failed) return;
runnable.clearTimeout();
err.uncaught = true;
self.fail(runnable, err);