Skip to content

armgit / mocha

Public Imported from GitHub
0

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

Undefined callback error in mocha.run() on browser

Jean Ponchon594d263eaffe
diff --git a/support/tail.js b/support/tail.js
index 018add8d..999d38da 100644
--- a/support/tail.js
+++ b/support/tail.js
@@ -135,12 +135,12 @@ mocha.run = function(fn){
if (query.grep) mocha.grep(query.grep);
if (query.invert) mocha.invert();
- return Mocha.prototype.run.call(mocha, function(){
+ return Mocha.prototype.run.call(mocha, function(err){
// The DOM Document is not available in Web Workers.
if (global.document) {
Mocha.utils.highlightTags('code');
}
- if (fn) fn();
+ if (fn) fn(err);
});
};