Skip to content

armgit / mocha

Public Imported from GitHub
0

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

Fixed event emitter leak. Closes #117

TJ Holowaychuke673963057eb
diff --git a/lib/runner.js b/lib/runner.js
index 17dad08a..68c669f5 100644
--- a/lib/runner.js
+++ b/lib/runner.js
@@ -159,6 +159,7 @@ Runner.prototype.hook = function(name, fn){
});
hook.run(function(err){
+ hook.removeAllListeners('error');
if (err) return self.failHook(hook, err);
self.emit('hook end', hook);
next(++i);