Skip to content

armgit / mocha

Public Imported from GitHub
0

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

port guillermo's stuff to support/tail.js

Tj Holowaychuk27fad9a8ef15
diff --git a/support/tail.js b/support/tail.js
index b00d7b10..6d3dd5ba 100644
--- a/support/tail.js
+++ b/support/tail.js
@@ -10,12 +10,22 @@
process = {};
process.nextTick = function(fn){ setTimeout(fn, 0); };
-process.removeListener = function(fn){};
-process.on = function(){};
process.exit = function(status){};
process.stdout = {};
global = this;
+process.removeListener = function(ev){
+ if ('uncaughtException' == ev) {
+ window.onerror = null;
+ }
+};
+
+process.on = function(ev, fn){
+ if ('uncaughtException' == ev) {
+ window.onerror = fn;
+ }
+};
+
mocha = require('mocha');
// boot