Skip to content

armgit / mocha

Public Imported from GitHub
0

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

rebuild mocha.js

Christopher Hillerbe1c1a42f959
diff --git a/mocha.js b/mocha.js
index 0dba2dd3..83e091b1 100644
--- a/mocha.js
+++ b/mocha.js
@@ -5,7 +5,7 @@ module.exports = process.env.COV
: require('./lib/mocha');
}).call(this,require('_process'))
-},{"./lib-cov/mocha":undefined,"./lib/mocha":14,"_process":50}],2:[function(require,module,exports){
+},{"./lib-cov/mocha":undefined,"./lib/mocha":14,"_process":51}],2:[function(require,module,exports){
/* eslint-disable no-unused-vars */
module.exports = function(type) {
return function() {};
@@ -594,7 +594,7 @@ module.exports = function(suite) {
});
};
-},{"../suite":37,"../test":38,"./common":9,"escape-string-regexp":67}],9:[function(require,module,exports){
+},{"../suite":37,"../test":38,"./common":9,"escape-string-regexp":68}],9:[function(require,module,exports){
'use strict';
/**
@@ -836,7 +836,7 @@ module.exports = function(suite) {
});
};
-},{"../suite":37,"../test":38,"./common":9,"escape-string-regexp":67}],13:[function(require,module,exports){
+},{"../suite":37,"../test":38,"./common":9,"escape-string-regexp":68}],13:[function(require,module,exports){
/**
* Module dependencies.
*/
@@ -943,7 +943,7 @@ module.exports = function(suite) {
});
};
-},{"../suite":37,"../test":38,"./common":9,"escape-string-regexp":67}],14:[function(require,module,exports){
+},{"../suite":37,"../test":38,"./common":9,"escape-string-regexp":68}],14:[function(require,module,exports){
(function (process,global,__dirname){
/*!
* mocha
@@ -1015,8 +1015,8 @@ function image(name) {
* - `fullTrace` display the full stack-trace on failing
* - `grep` string or regexp to filter tests with
*
- * @api public
* @param {Object} options
+ * @api public
*/
function Mocha(options) {
options = options || {};
@@ -1088,6 +1088,8 @@ Mocha.prototype.addFile = function(file) {
/**
* Set reporter to `reporter`, defaults to "spec".
*
+ * @param {String|Function} reporter name or constructor
+ * @param {Object} reporterOptions optional options
* @api public
* @param {string|Function} reporter name or constructor
* @param {Object} reporterOptions optional options
@@ -1190,6 +1192,8 @@ Mocha.prototype._growl = function(runner, reporter) {
/**
* Add regexp to grep, if `re` is a string it is escaped.
*
+ * @param {RegExp|String} re
+ * @return {Mocha}
* @api public
* @param {RegExp|string} re
* @return {Mocha}
@@ -1202,8 +1206,8 @@ Mocha.prototype.grep = function(re) {
/**
* Invert `.grep()` matches.
*
- * @api public
* @return {Mocha}
+ * @api public
*/
Mocha.prototype.invert = function() {
this.options.invert = true;
@@ -1213,6 +1217,8 @@ Mocha.prototype.invert = function() {
/**
* Ignore global leaks.
*
+ * @param {Boolean} ignore
+ * @return {Mocha}
* @api public
* @param {boolean} ignore
* @return {Mocha}
@@ -1225,8 +1231,8 @@ Mocha.prototype.ignoreLeaks = function(ignore) {
/**
* Enable global leak checking.
*
- * @api public
* @return {Mocha}
+ * @api public
*/
Mocha.prototype.checkLeaks = function() {
this.options.ignoreLeaks = false;
@@ -1236,8 +1242,8 @@ Mocha.prototype.checkLeaks = function() {
/**
* Display long stack-trace on failing
*
- * @api public
* @return {Mocha}
+ * @api public
*/
Mocha.prototype.fullTrace = function() {
this.options.fullStackTrace = true;
@@ -1247,8 +1253,8 @@ Mocha.prototype.fullTrace = function() {
/**
* Enable growl support.
*
- * @api public
* @return {Mocha}
+ * @api public
*/
Mocha.prototype.growl = function() {
this.options.growl = true;
@@ -1258,6 +1264,8 @@ Mocha.prototype.growl = function() {
/**
* Ignore `globals` array or string.
*
+ * @param {Array|String} globals
+ * @return {Mocha}
* @api public
* @param {Array|string} globals
* @return {Mocha}
@@ -1270,6 +1278,8 @@ Mocha.prototype.globals = function(globals) {
/**
* Emit color output.
*
+ * @param {Boolean} colors
+ * @return {Mocha}
* @api public
* @param {boolean} colors
* @return {Mocha}
@@ -1284,6 +1294,8 @@ Mocha.prototype.useColors = function(colors) {
/**
* Use inline diffs rather than +/-.
*
+ * @param {Boolean} inlineDiffs
+ * @return {Mocha}
* @api public
* @param {boolean} inlineDiffs
* @return {Mocha}
@@ -1296,6 +1308,8 @@ Mocha.prototype.useInlineDiffs = function(inlineDiffs) {
/**
* Set the timeout in milliseconds.
*
+ * @param {Number} timeout
+ * @return {Mocha}
* @api public
* @param {number} timeout
* @return {Mocha}
@@ -1308,6 +1322,8 @@ Mocha.prototype.timeout = function(timeout) {
/**
* Set slowness threshold in milliseconds.
*
+ * @param {Number} slow
+ * @return {Mocha}
* @api public
* @param {number} slow
* @return {Mocha}
@@ -1320,6 +1336,8 @@ Mocha.prototype.slow = function(slow) {
/**
* Enable timeouts.
*
+ * @param {Boolean} enabled
+ * @return {Mocha}
* @api public
* @param {boolean} enabled
* @return {Mocha}
@@ -1332,8 +1350,8 @@ Mocha.prototype.enableTimeouts = function(enabled) {
/**
* Makes all tests async (accepting a callback)
*
- * @api public
* @return {Mocha}
+ * @api public
*/
Mocha.prototype.asyncOnly = function() {
this.options.asyncOnly = true;
@@ -1344,7 +1362,6 @@ Mocha.prototype.asyncOnly = function() {
* Disable syntax highlighting (in browser).
*
* @api public
- * @returns {Mocha}
*/
Mocha.prototype.noHighlighting = function() {
this.options.noHighlighting = true;
@@ -1352,9 +1369,18 @@ Mocha.prototype.noHighlighting = function() {
};
/**
- * Delay root suite execution.
+ * Enable uncaught errors to propagate (in browser).
*
+ * @return {Mocha}
* @api public
+ */
+Mocha.prototype.allowUncaught = function() {
+ this.options.allowUncaught = true;
+ return this;
+};
+
+/**
+ * Delay root suite execution.
* @returns {Mocha}
*/
Mocha.prototype.delay = function delay() {
@@ -1381,6 +1407,7 @@ Mocha.prototype.run = function(fn) {
runner.ignoreLeaks = options.ignoreLeaks !== false;
runner.fullStackTrace = options.fullStackTrace;
runner.asyncOnly = options.asyncOnly;
+ runner.allowUncaught = options.allowUncaught;
if (options.grep) {
runner.grep(options.grep, options.invert);
}
@@ -1407,7 +1434,7 @@ Mocha.prototype.run = function(fn) {
};
}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},"/lib")
-},{"./context":6,"./hook":7,"./interfaces":11,"./reporters":22,"./runnable":35,"./runner":36,"./suite":37,"./test":38,"./utils":39,"_process":50,"escape-string-regexp":67,"growl":68,"path":41}],15:[function(require,module,exports){
+},{"./context":6,"./hook":7,"./interfaces":11,"./reporters":22,"./runnable":35,"./runner":36,"./suite":37,"./test":38,"./utils":39,"_process":51,"escape-string-regexp":68,"growl":69,"path":41}],15:[function(require,module,exports){
/**
* Helpers.
*/
@@ -2038,7 +2065,7 @@ function sameType(a, b) {
}
}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-},{"../ms":15,"../utils":39,"_process":50,"diff":66,"supports-color":41,"tty":5}],18:[function(require,module,exports){
+},{"../ms":15,"../utils":39,"_process":51,"diff":67,"supports-color":41,"tty":5}],18:[function(require,module,exports){
/**
* Module dependencies.
*/
@@ -2175,7 +2202,7 @@ Dot.prototype = create(Base.prototype, {
});
}).call(this,require('_process'))
-},{"./base":17,"_process":50,"lodash.create":70}],20:[function(require,module,exports){
+},{"./base":17,"_process":51,"lodash.create":70}],20:[function(require,module,exports){
(function (process,__dirname){
/**
* Module dependencies.
@@ -2200,9 +2227,9 @@ exports = module.exports = HTMLCov;
function HTMLCov(runner) {
var jade = require('jade');
var file = join(__dirname, '/templates/coverage.jade');
+ var str = readFileSync(file, 'utf8');
var fn = jade.compile(str, { filename: file });
var self = this;
- var str = readFileSync(file, 'utf8');
JSONCov.call(this, runner, false);
@@ -2235,7 +2262,7 @@ function coverageClass(coveragePctg) {
}
}).call(this,require('_process'),"/lib/reporters")
-},{"./json-cov":23,"_process":50,"fs":41,"jade":41,"path":41}],21:[function(require,module,exports){
+},{"./json-cov":23,"_process":51,"fs":41,"jade":41,"path":41}],21:[function(require,module,exports){
(function (global){
/* eslint-env browser */
@@ -2565,7 +2592,7 @@ function on(el, event, fn) {
}
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-},{"../browser/progress":4,"../utils":39,"./base":17,"escape-string-regexp":67}],22:[function(require,module,exports){
+},{"../browser/progress":4,"../utils":39,"./base":17,"escape-string-regexp":68}],22:[function(require,module,exports){
// Alias exports to a their normalized format Mocha#reporter to prevent a need
// for dynamic (try/catch) requires, which Browserify doesn't handle.
exports.Base = exports.base = require('./base');
@@ -2740,7 +2767,7 @@ function clean(test) {
}
}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-},{"./base":17,"_process":50}],24:[function(require,module,exports){
+},{"./base":17,"_process":51}],24:[function(require,module,exports){
(function (process){
/**
* Module dependencies.
@@ -2803,7 +2830,7 @@ function clean(test) {
}
}).call(this,require('_process'))
-},{"./base":17,"_process":50}],25:[function(require,module,exports){
+},{"./base":17,"_process":51}],25:[function(require,module,exports){
(function (process){
/**
* Module dependencies.
@@ -2896,7 +2923,7 @@ function errorJSON(err) {
}
}).call(this,require('_process'))
-},{"./base":17,"_process":50}],26:[function(require,module,exports){
+},{"./base":17,"_process":51}],26:[function(require,module,exports){
(function (process){
/**
* Module dependencies.
@@ -2995,7 +3022,7 @@ Landing.prototype = create(Base.prototype, {
});
}).call(this,require('_process'))
-},{"./base":17,"_process":50,"lodash.create":70}],27:[function(require,module,exports){
+},{"./base":17,"_process":51,"lodash.create":70}],27:[function(require,module,exports){
(function (process){
/**
* Module dependencies.
@@ -3063,7 +3090,7 @@ List.prototype = create(Base.prototype, {
});
}).call(this,require('_process'))
-},{"./base":17,"_process":50,"lodash.create":70}],28:[function(require,module,exports){
+},{"./base":17,"_process":51,"lodash.create":70}],28:[function(require,module,exports){
(function (process){
/**
* Module dependencies.
@@ -3164,7 +3191,7 @@ function Markdown(runner) {
}
}).call(this,require('_process'))
-},{"../utils":39,"./base":17,"_process":50}],29:[function(require,module,exports){
+},{"../utils":39,"./base":17,"_process":51}],29:[function(require,module,exports){
(function (process){
/**
* Module dependencies.
@@ -3207,7 +3234,7 @@ Min.prototype = create(Base.prototype, {
});
}).call(this,require('_process'))
-},{"./base":17,"_process":50,"lodash.create":70}],30:[function(require,module,exports){
+},{"./base":17,"_process":51,"lodash.create":70}],30:[function(require,module,exports){
(function (process){
/**
* Module dependencies.
@@ -3475,7 +3502,7 @@ function write(string) {
}
}).call(this,require('_process'))
-},{"./base":17,"_process":50,"lodash.create":70}],31:[function(require,module,exports){
+},{"./base":17,"_process":51,"lodash.create":70}],31:[function(require,module,exports){
(function (process){
/**
* Module dependencies.
@@ -3571,7 +3598,7 @@ Progress.prototype = create(Base.prototype, {
});
}).call(this,require('_process'))
-},{"./base":17,"_process":50,"lodash.create":70}],32:[function(require,module,exports){
+},{"./base":17,"_process":51,"lodash.create":70}],32:[function(require,module,exports){
/**
* Module dependencies.
*/
@@ -3944,6 +3971,8 @@ module.exports = Runnable;
/**
* Initialize a new `Runnable` with the given `title` and callback `fn`.
*
+ * @param {String} title
+ * @param {Function} fn
* @api private
* @param {string} title
* @param {Function} fn
@@ -4113,8 +4142,8 @@ Runnable.prototype.globals = function(globals) {
/**
* Run the test and invoke `fn(err)`.
*
- * @api private
* @param {Function} fn
+ * @api private
*/
Runnable.prototype.run = function(fn) {
var self = this;
@@ -4163,27 +4192,21 @@ Runnable.prototype.run = function(fn) {
if (this.async) {
this.resetTimeout();
+ if (this.allowUncaught) {
+ return callFnAsync(this.fn);
+ }
try {
- this.fn.call(ctx, function(err) {
- if (err instanceof Error || toString.call(err) === '[object Error]') {
- return done(err);
- }
- if (err != null) {
- if (Object.prototype.toString.call(err) === '[object Object]') {
- return done(new Error('done() invoked with non-Error: ' + JSON.stringify(err)));
- }
- return done(new Error('done() invoked with non-Error: ' + err));
- }
- done();
- });
+ callFnAsync(this.fn);
} catch (err) {
done(utils.getError(err));
}
return;
}
- if (this.asyncOnly) {
- return done(new Error('--async-only option in use without declaring `done()`'));
+ if (this.allowUncaught) {
+ callFn(this.fn);
+ done();
+ return;
}
// sync or promise-returning
@@ -4209,9 +4232,29 @@ Runnable.prototype.run = function(fn) {
done(reason || new Error('Promise rejected with no or falsy reason'));
});
} else {
+ if (self.asyncOnly) {
+ return done(new Error('--async-only option in use without declaring `done()` or returning a promise'));
+ }
+
done();
}
}
+
+ function callFnAsync(fn) {
+ fn.call(ctx, function(err) {
+ if (err instanceof Error || toString.call(err) === '[object Error]') {
+ return done(err);
+ }
+ if (err) {
+ if (Object.prototype.toString.call(err) === '[object Object]') {
+ return done(new Error('done() invoked with non-Error: '
+ + JSON.stringify(err)));
+ }
+ return done(new Error('done() invoked with non-Error: ' + err));
+ }
+ done();
+ });
+ }
};
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
@@ -4290,15 +4333,16 @@ function Runner(suite, delay) {
this.on('hook end', function(hook) {
self.checkGlobals(hook);
});
- this.grep(/.*/);
+ this._defaultGrep = /.*/;
+ this.grep(this._defaultGrep);
this.globals(this.globalProps().concat(extraGlobals()));
}
/**
* Wrapper for setImmediate, process.nextTick, or browser polyfill.
*
- * @api private
* @param {Function} fn
+ * @api private
*/
Runner.immediately = global.setImmediate || process.nextTick;
@@ -4314,6 +4358,9 @@ Runner.prototype = create(EventEmitter.prototype, {
* Run tests with full titles matching `re`. Updates runner.total
* with number of tests matched.
*
+ * @param {RegExp} re
+ * @param {Boolean} invert
+ * @return {Runner} for chaining
* @api public
* @param {RegExp} re
* @param {boolean} invert
@@ -4331,6 +4378,8 @@ Runner.prototype.grep = function(re, invert) {
* Returns the number of tests matching the grep search for the
* given suite.
*
+ * @param {Suite} suite
+ * @return {Number}
* @api public
* @param {Suite} suite
* @return {number}
@@ -4355,8 +4404,8 @@ Runner.prototype.grepTotal = function(suite) {
/**
* Return a list of global properties.
*
- * @api private
* @return {Array}
+ * @api private
*/
Runner.prototype.globalProps = function() {
var props = keys(global);
@@ -4375,6 +4424,8 @@ Runner.prototype.globalProps = function() {
/**
* Allow the given `arr` of globals.
*
+ * @param {Array} arr
+ * @return {Runner} for chaining
* @api public
* @param {Array} arr
* @return {Runner} Runner instance.
@@ -4464,6 +4515,11 @@ Runner.prototype.fail = function(test, err) {
* @param {Error} err
*/
Runner.prototype.failHook = function(hook, err) {
+ if (hook.ctx && hook.ctx.currentTest) {
+ hook.originalTitle = hook.originalTitle || hook.title;
+ hook.title = hook.originalTitle + ' for "' + hook.ctx.currentTest.title + '"';
+ }
+
this.fail(hook, err);
if (this.suite.bail()) {
this.emit('end');
@@ -4477,6 +4533,7 @@ Runner.prototype.failHook = function(hook, err) {
* @param {string} name
* @param {Function} fn
*/
+
Runner.prototype.hook = function(name, fn) {
var suite = this.suite;
var hooks = suite['_' + name];
@@ -4562,9 +4619,9 @@ Runner.prototype.hooks = function(name, suites, fn) {
/**
* Run hooks from the top level down.
*
- * @api private
- * @param {string} name
+ * @param {String} name
* @param {Function} fn
+ * @api private
*/
Runner.prototype.hookUp = function(name, fn) {
var suites = [this.suite].concat(this.parents()).reverse();
@@ -4574,9 +4631,9 @@ Runner.prototype.hookUp = function(name, fn) {
/**
* Run hooks from the bottom up.
*
- * @api private
- * @param {string} name
+ * @param {String} name
* @param {Function} fn
+ * @api private
*/
Runner.prototype.hookDown = function(name, fn) {
var suites = [this.suite].concat(this.parents());
@@ -4587,8 +4644,8 @@ Runner.prototype.hookDown = function(name, fn) {
* Return an array of parent Suites from
* closest to furthest.
*
- * @api private
* @return {Array}
+ * @api private
*/
Runner.prototype.parents = function() {
var suite = this.suite;
@@ -4602,8 +4659,8 @@ Runner.prototype.parents = function() {
/**
* Run the current test and callback `fn(err)`.
*
- * @api private
* @param {Function} fn
+ * @api private
*/
Runner.prototype.runTest = function(fn) {
var self = this;
@@ -4613,6 +4670,10 @@ Runner.prototype.runTest = function(fn) {
test.asyncOnly = true;
}
+ if (this.allowUncaught) {
+ test.allowUncaught = true;
+ return test.run(fn);
+ }
try {
test.on('error', function(err) {
self.fail(test, err);
@@ -4689,7 +4750,20 @@ Runner.prototype.runTests = function(suite, fn) {
match = !match;
}
if (!match) {
- return next();
+ // Run immediately only if we have defined a grep. When we
+ // define a grep — It can cause maximum callstack error if
+ // the grep is doing a large recursive loop by neglecting
+ // all tests. The run immediately function also comes with
+ // a performance cost. So we don't want to run immediately
+ // if we run the whole test suite, because running the whole
+ // test suite don't do any immediate recursive loops. Thus,
+ // allowing a JS runtime to breathe.
+ if (self._grep !== self._defaultGrep) {
+ Runner.immediately(next);
+ } else {
+ next();
+ }
+ return;
}
// pending
@@ -4738,6 +4812,7 @@ Runner.prototype.runTests = function(suite, fn) {
}
this.next = next;
+ this.hookErr = hookErr;
next();
};
@@ -4752,6 +4827,7 @@ Runner.prototype.runSuite = function(suite, fn) {
var i = 0;
var self = this;
var total = this.grepTotal(suite);
+ var afterAllHookCalled = false;
debug('run suite %s', suite.fullTitle());
@@ -4782,17 +4858,38 @@ Runner.prototype.runSuite = function(suite, fn) {
if (!curr) {
return done();
}
- self.runSuite(curr, next);
+
+ // Avoid grep neglecting large number of tests causing a
+ // huge recursive loop and thus a maximum call stack error.
+ // See comment in `this.runTests()` for more information.
+ if (self._grep !== self._defaultGrep) {
+ Runner.immediately(function() {
+ self.runSuite(curr, next);
+ });
+ } else {
+ self.runSuite(curr, next);
+ }
}
function done(errSuite) {
self.suite = suite;
- self.hook('afterAll', function() {
- self.emit('suite end', suite);
+ self.nextSuite = next;
+
+ if (afterAllHookCalled) {
fn(errSuite);
- });
+ } else {
+ // mark that the afterAll block has been called once
+ // and so can be skipped if there is an error in it.
+ afterAllHookCalled = true;
+ self.hook('afterAll', function() {
+ self.emit('suite end', suite);
+ fn(errSuite);
+ });
+ }
}
+ this.nextSuite = next;
+
this.hook('beforeAll', function(err) {
if (err) {
return done();
@@ -4804,8 +4901,8 @@ Runner.prototype.runSuite = function(suite, fn) {
/**
* Handle uncaught exceptions.
*
- * @api private
* @param {Error} err
+ * @api private
*/
Runner.prototype.uncaught = function(err) {
if (err) {
@@ -4838,7 +4935,22 @@ Runner.prototype.uncaught = function(err) {
return;
}
- // bail on hooks
+ // recover from hooks
+ if (runnable.type === 'hook') {
+ var errSuite = this.suite;
+ // if hook failure is in afterEach block
+ if (runnable.fullTitle().indexOf('after each') > -1) {
+ return this.hookErr(err, errSuite, true);
+ }
+ // if hook failure is in beforeEach block
+ if (runnable.fullTitle().indexOf('before each') > -1) {
+ return this.hookErr(err, errSuite, false);
+ }
+ // if hook failure is in after or before blocks
+ return this.nextSuite(errSuite);
+ }
+
+ // bail
this.emit('end');
};
@@ -4846,6 +4958,8 @@ Runner.prototype.uncaught = function(err) {
* Run the root suite and invoke `fn(failures)`
* on completion.
*
+ * @param {Function} fn
+ * @return {Runner} for chaining
* @api public
* @param {Function} fn
* @return {Runner} Runner instance.
@@ -4951,11 +5065,11 @@ function filterLeaks(ok, globals) {
/**
* Array of globals dependent on the environment.
*
- * @api private
* @return {Array}
+ * @api private
*/
function extraGlobals() {
- if (!process.browser) {
+ if (typeof process === 'object' && typeof process.version === 'string') {
var nodeVersion = process.version.split('.').reduce(function(a, v) {
return a << 8 | v;
});
@@ -4971,7 +5085,7 @@ function extraGlobals() {
}
}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-},{"./pending":16,"./utils":39,"_process":50,"debug":2,"events":3,"lodash.create":70}],37:[function(require,module,exports){
+},{"./pending":16,"./utils":39,"_process":51,"debug":2,"events":3,"lodash.create":70}],37:[function(require,module,exports){
/**
* Module dependencies.
*/
@@ -6120,7 +6234,7 @@ exports.stackTraceFilter = function() {
};
}).call(this,require('_process'),require("buffer").Buffer)
-},{"_process":50,"buffer":43,"debug":2,"fs":41,"glob":41,"path":41}],40:[function(require,module,exports){
+},{"_process":51,"buffer":43,"debug":2,"fs":41,"glob":41,"path":41}],40:[function(require,module,exports){
(function (process){
var WritableStream = require('stream').Writable
var inherits = require('util').inherits
@@ -6140,11 +6254,16 @@ function BrowserStdout(opts) {
BrowserStdout.prototype._write = function(chunks, encoding, cb) {
var output = chunks.toString ? chunks.toString() : chunks
- console.log(this.label+':', output)
+ if (this.label === false) {
+ console.log(output)
+ } else {
+ console.log(this.label+':', output)
+ }
process.nextTick(cb)
}
+
}).call(this,require('_process'))
-},{"_process":50,"stream":62,"util":65}],41:[function(require,module,exports){
+},{"_process":51,"stream":63,"util":66}],41:[function(require,module,exports){
},{}],42:[function(require,module,exports){
arguments[4][41][0].apply(exports,arguments)
@@ -8135,11 +8254,36 @@ function isUndefined(arg) {
}
},{}],48:[function(require,module,exports){
+if (typeof Object.create === 'function') {
+ // implementation from standard node.js 'util' module
+ module.exports = function inherits(ctor, superCtor) {
+ ctor.super_ = superCtor
+ ctor.prototype = Object.create(superCtor.prototype, {
+ constructor: {
+ value: ctor,
+ enumerable: false,
+ writable: true,
+ configurable: true
+ }
+ });
+ };
+} else {
+ // old school shim for old browsers
+ module.exports = function inherits(ctor, superCtor) {
+ ctor.super_ = superCtor
+ var TempCtor = function () {}
+ TempCtor.prototype = superCtor.prototype
+ ctor.prototype = new TempCtor()
+ ctor.prototype.constructor = ctor
+ }
+}
+
+},{}],49:[function(require,module,exports){
module.exports = Array.isArray || function (arr) {
return Object.prototype.toString.call(arr) == '[object Array]';
};
-},{}],49:[function(require,module,exports){
+},{}],50:[function(require,module,exports){
exports.endianness = function () { return 'LE' };
exports.hostname = function () {
@@ -8186,7 +8330,7 @@ exports.tmpdir = exports.tmpDir = function () {
exports.EOL = '\n';
-},{}],50:[function(require,module,exports){
+},{}],51:[function(require,module,exports){
// shim for using process in browser
var process = module.exports = {};
@@ -8278,10 +8422,10 @@ process.chdir = function (dir) {
};
process.umask = function() { return 0; };
-},{}],51:[function(require,module,exports){
+},{}],52:[function(require,module,exports){
module.exports = require("./lib/_stream_duplex.js")
-},{"./lib/_stream_duplex.js":52}],52:[function(require,module,exports){
+},{"./lib/_stream_duplex.js":53}],53:[function(require,module,exports){
(function (process){
// Copyright Joyent, Inc. and other Node contributors.
//
@@ -8374,7 +8518,7 @@ function forEach (xs, f) {
}
}).call(this,require('_process'))
-},{"./_stream_readable":54,"./_stream_writable":56,"_process":50,"core-util-is":57,"inherits":69}],53:[function(require,module,exports){
+},{"./_stream_readable":55,"./_stream_writable":57,"_process":51,"core-util-is":58,"inherits":48}],54:[function(require,module,exports){
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
@@ -8422,7 +8566,7 @@ PassThrough.prototype._transform = function(chunk, encoding, cb) {
cb(null, chunk);
};
-},{"./_stream_transform":55,"core-util-is":57,"inherits":69}],54:[function(require,module,exports){
+},{"./_stream_transform":56,"core-util-is":58,"inherits":48}],55:[function(require,module,exports){
(function (process){
// Copyright Joyent, Inc. and other Node contributors.
//
@@ -9377,7 +9521,7 @@ function indexOf (xs, x) {
}
}).call(this,require('_process'))
-},{"./_stream_duplex":52,"_process":50,"buffer":43,"core-util-is":57,"events":47,"inherits":69,"isarray":48,"stream":62,"string_decoder/":63,"util":42}],55:[function(require,module,exports){
+},{"./_stream_duplex":53,"_process":51,"buffer":43,"core-util-is":58,"events":47,"inherits":48,"isarray":49,"stream":63,"string_decoder/":64,"util":42}],56:[function(require,module,exports){
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
@@ -9588,7 +9732,7 @@ function done(stream, er) {
return stream.push(null);
}
-},{"./_stream_duplex":52,"core-util-is":57,"inherits":69}],56:[function(require,module,exports){
+},{"./_stream_duplex":53,"core-util-is":58,"inherits":48}],57:[function(require,module,exports){
(function (process){
// Copyright Joyent, Inc. and other Node contributors.
//
@@ -10069,7 +10213,7 @@ function endWritable(stream, state, cb) {
}
}).call(this,require('_process'))
-},{"./_stream_duplex":52,"_process":50,"buffer":43,"core-util-is":57,"inherits":69,"stream":62}],57:[function(require,module,exports){
+},{"./_stream_duplex":53,"_process":51,"buffer":43,"core-util-is":58,"inherits":48,"stream":63}],58:[function(require,module,exports){
(function (Buffer){
// Copyright Joyent, Inc. and other Node contributors.
//
@@ -10179,10 +10323,10 @@ function objectToString(o) {
return Object.prototype.toString.call(o);
}
}).call(this,require("buffer").Buffer)
-},{"buffer":43}],58:[function(require,module,exports){
+},{"buffer":43}],59:[function(require,module,exports){
module.exports = require("./lib/_stream_passthrough.js")
-},{"./lib/_stream_passthrough.js":53}],59:[function(require,module,exports){
+},{"./lib/_stream_passthrough.js":54}],60:[function(require,module,exports){
exports = module.exports = require('./lib/_stream_readable.js');
exports.Stream = require('stream');
exports.Readable = exports;
@@ -10191,13 +10335,13 @@ exports.Duplex = require('./lib/_stream_duplex.js');
exports.Transform = require('./lib/_stream_transform.js');
exports.PassThrough = require('./lib/_stream_passthrough.js');
-},{"./lib/_stream_duplex.js":52,"./lib/_stream_passthrough.js":53,"./lib/_stream_readable.js":54,"./lib/_stream_transform.js":55,"./lib/_stream_writable.js":56,"stream":62}],60:[function(require,module,exports){
+},{"./lib/_stream_duplex.js":53,"./lib/_stream_passthrough.js":54,"./lib/_stream_readable.js":55,"./lib/_stream_transform.js":56,"./lib/_stream_writable.js":57,"stream":63}],61:[function(require,module,exports){
module.exports = require("./lib/_stream_transform.js")
-},{"./lib/_stream_transform.js":55}],61:[function(require,module,exports){
+},{"./lib/_stream_transform.js":56}],62:[function(require,module,exports){
module.exports = require("./lib/_stream_writable.js")
-},{"./lib/_stream_writable.js":56}],62:[function(require,module,exports){
+},{"./lib/_stream_writable.js":57}],63:[function(require,module,exports){
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
@@ -10326,7 +10470,7 @@ Stream.prototype.pipe = function(dest, options) {
return dest;
};
-},{"events":47,"inherits":69,"readable-stream/duplex.js":51,"readable-stream/passthrough.js":58,"readable-stream/readable.js":59,"readable-stream/transform.js":60,"readable-stream/writable.js":61}],63:[function(require,module,exports){
+},{"events":47,"inherits":48,"readable-stream/duplex.js":52,"readable-stream/passthrough.js":59,"readable-stream/readable.js":60,"readable-stream/transform.js":61,"readable-stream/writable.js":62}],64:[function(require,module,exports){
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
@@ -10549,14 +10693,14 @@ function base64DetectIncompleteChar(buffer) {
this.charLength = this.charReceived ? 3 : 0;
}
-},{"buffer":43}],64:[function(require,module,exports){
+},{"buffer":43}],65:[function(require,module,exports){
module.exports = function isBuffer(arg) {
return arg && typeof arg === 'object'
&& typeof arg.copy === 'function'
&& typeof arg.fill === 'function'
&& typeof arg.readUInt8 === 'function';
}
-},{}],65:[function(require,module,exports){
+},{}],66:[function(require,module,exports){
(function (process,global){
// Copyright Joyent, Inc. and other Node contributors.
//
@@ -11146,7 +11290,7 @@ function hasOwnProperty(obj, prop) {
}
}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-},{"./support/isBuffer":64,"_process":50,"inherits":69}],66:[function(require,module,exports){
+},{"./support/isBuffer":65,"_process":51,"inherits":48}],67:[function(require,module,exports){
/* See LICENSE file for terms of use */
/*
@@ -11767,7 +11911,7 @@ function hasOwnProperty(obj, prop) {
}
}(this));
-},{}],67:[function(require,module,exports){
+},{}],68:[function(require,module,exports){
'use strict';
var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
@@ -11780,7 +11924,7 @@ module.exports = function (str) {
return str.replace(matchOperatorsRe, '\\$&');
};
-},{}],68:[function(require,module,exports){
+},{}],69:[function(require,module,exports){
(function (process){
// Growl - Copyright TJ Holowaychuk <[email protected]> (MIT Licensed)
@@ -12018,32 +12162,7 @@ function growl(msg, options, fn) {
};
}).call(this,require('_process'))
-},{"_process":50,"child_process":41,"fs":41,"os":49,"path":41}],69:[function(require,module,exports){
-if (typeof Object.create === 'function') {
- // implementation from standard node.js 'util' module
- module.exports = function inherits(ctor, superCtor) {
- ctor.super_ = superCtor
- ctor.prototype = Object.create(superCtor.prototype, {
- constructor: {
- value: ctor,
- enumerable: false,
- writable: true,
- configurable: true
- }
- });
- };
-} else {
- // old school shim for old browsers
- module.exports = function inherits(ctor, superCtor) {
- ctor.super_ = superCtor
- var TempCtor = function () {}
- TempCtor.prototype = superCtor.prototype
- ctor.prototype = new TempCtor()
- ctor.prototype.constructor = ctor
- }
-}
-
-},{}],70:[function(require,module,exports){
+},{"_process":51,"child_process":41,"fs":41,"os":50,"path":41}],70:[function(require,module,exports){
/**
* lodash 3.1.1 (Custom Build) <https://lodash.com/>
* Build: `lodash modern modularize exports="npm" -o ./`
@@ -13025,6 +13144,12 @@ module.exports = isIterateeCall;
},{}],79:[function(require,module,exports){
(function (process,global){
+/**
+ * Shim process.stdout.
+ */
+
+process.stdout = require('browser-stdout')();
+
var Mocha = require('../');
/**
@@ -13074,7 +13199,7 @@ process.on = function(e, fn){
if ('uncaughtException' == e) {
global.onerror = function(err, url, line){
fn(new Error(err + ' (' + url + ':' + line + ')'));
- return true;
+ return !mocha.allowUncaught;
};
uncaughtExceptionHandlers.push(fn);
}
@@ -13167,12 +13292,6 @@ mocha.run = function(fn){
});
};
-/**
- * Shim process.stdout.
- */
-
-process.stdout = require('browser-stdout')();
-
/**
* Expose the process shim.
* https://github.com/mochajs/mocha/pull/916
@@ -13188,4 +13307,4 @@ window.Mocha = Mocha;
window.mocha = mocha;
}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-},{"../":1,"_process":50,"browser-stdout":40}]},{},[79]);
+},{"../":1,"_process":51,"browser-stdout":40}]},{},[79]);