Skip to content

armgit / mocha

Public Imported from GitHub
0

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

Fixed: clear timeout on uncaught exceptions. Closes #131

Tj Holowaychuk92cb0c1994a4
diff --git a/lib/runner.js b/lib/runner.js
index 3613dbed..0ea294ae 100644
--- a/lib/runner.js
+++ b/lib/runner.js
@@ -391,6 +391,7 @@ Runner.prototype.run = function(fn){
// uncaught exception
function uncaught(err){
debug('uncaught exception');
+ self.currentRunnable.clearTimeout();
self.fail(self.currentRunnable, err);
self.emit('test end', self.test);
self.emit('end');