Skip to content

armgit / mocha

Public Imported from GitHub
0

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

optional runner function

TJ Holowaychuk25c6248a57df
diff --git a/lib/runner.js b/lib/runner.js
index 2f9be465..17dad08a 100644
--- a/lib/runner.js
+++ b/lib/runner.js
@@ -363,7 +363,8 @@ Runner.prototype.runSuite = function(suite, fn){
*/
Runner.prototype.run = function(fn){
- var self = this;
+ var self = this
+ , fn = fn || function(){};
// callback
self.on('end', function(){
diff --git a/mocha.js b/mocha.js
index 1b765f10..961429d9 100644
--- a/mocha.js
+++ b/mocha.js
@@ -1970,7 +1970,8 @@ Runner.prototype.runSuite = function(suite, fn){
*/
Runner.prototype.run = function(fn){
- var self = this;
+ var self = this
+ , fn = fn || function(){};
// callback
self.on('end', function(){
@@ -2317,6 +2318,7 @@ module.exports = function(paths, fn){
process = {};
process.nextTick = function(fn){ setTimeout(fn, 0); };
+process.removeListener = function(fn){};
process.on = function(){};
process.exit = function(status){};
process.stdout = {};
diff --git a/support/tail.js b/support/tail.js
index 9cb34be0..df46a53b 100644
--- a/support/tail.js
+++ b/support/tail.js
@@ -10,6 +10,7 @@
process = {};
process.nextTick = function(fn){ setTimeout(fn, 0); };
+process.removeListener = function(fn){};
process.on = function(){};
process.exit = function(status){};
process.stdout = {};