Skip to content

armgit / mocha

Public Imported from GitHub
0

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

pass global leaks error on window.onerror in browser

Yuest Wangd456a996f9a3
diff --git a/lib/runner.js b/lib/runner.js
index 39d09d7a..40535e2a 100644
--- a/lib/runner.js
+++ b/lib/runner.js
@@ -92,7 +92,7 @@ Runner.prototype.checkGlobals = function(test){
if (this.ignoreLeaks) return;
var leaks = utils.filter(utils.keys(global), function(key){
- return !~utils.indexOf(this._globals, key);
+ return !~utils.indexOf(this._globals, key) && (!global.navigator || 'onerror' !== key);
}, this);
this._globals = this._globals.concat(leaks);