Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save craigtaub/871d6a0d886f875ed2a2c1ec8b7f7fd5 to your computer and use it in GitHub Desktop.
Save craigtaub/871d6a0d886f875ed2a2c1ec8b7f7fd5 to your computer and use it in GitHub Desktop.
Mocha.prototype.run = function (fn) {
var suite = this.suite;
var options = this.options;
options.files = this.files;
var runner = new Runner(suite, options.delay);
createStatsCollector(runner);
var reporter = new this._reporter(runner, options);
const noop = () => "";
function done(failures) {
fn = fn || noop;
if (reporter.done) {
reporter.done(failures, fn);
} else {
fn(failures);
}
}
return runner.run(done);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment