☕️ Classic, reliable, trusted test framework for Node.js and the browser
same change, less verbose
Jesse Dailey451561760f3e
diff --git a/lib/runner.js b/lib/runner.jsindex b52732a2..3607ce40 100644--- a/lib/runner.js+++ b/lib/runner.js@@ -10,11 +10,7 @@ var EventEmitter = require('events').EventEmitter, filter = utils.filter, keys = utils.keys, noop = function(){}- , immediately = process.nextTick;--if( global.setImmediate != undefined ) {- immediately = global.setImmediate;-}+ , immediately = global.setImmediate || process.nextTick;/*** Non-enumerable globals.diff --git a/mocha.js b/mocha.jsindex 0ec5d06f..408c3dd4 100644--- a/mocha.js+++ b/mocha.js@@ -4066,7 +4066,8 @@ var EventEmitter = require('browser/events').EventEmitter, utils = require('./utils'), filter = utils.filter, keys = utils.keys- , noop = function(){};+ , noop = function(){}+ , immediately = global.setImmediate || process.nextTick;/*** Non-enumerable globals.@@ -4246,7 +4247,7 @@ Runner.prototype.fail = function(test, err){if ('string' == typeof err) {err = new Error('the string "' + err + '" was thrown, throw an Error :)');}-+this.emit('fail', test, err);};@@ -4303,7 +4304,7 @@ Runner.prototype.hook = function(name, fn){});}- process.nextTick(function(){+ immediately(function(){next(0);});};@@ -4544,10 +4545,11 @@ Runner.prototype.uncaught = function(err){Runner.prototype.run = function(fn){var self = this- , fn = fn || function(){}- , uncaught = function(err){- self.uncaught(err);- };+ , fn = fn || function(){};++ function uncaught(err){+ self.uncaught(err);+ }debug('start');