Skip to content

Commit

Permalink
Instantiate Runner earlier in Mocha constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
juergba committed Mar 14, 2019
1 parent d1024a3 commit 2338a41
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/mocha.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ function Mocha(options) {
this[opt]();
}
}, this);

this.runner = new exports.Runner(this.suite, options.delay);
}

/**
Expand Down Expand Up @@ -803,10 +805,11 @@ Mocha.prototype.run = function(fn) {
if (this.files.length) {
this.loadFiles();
}
var suite = this.suite;
// var suite = this.suite;
var options = this.options;
options.files = this.files;
var runner = new exports.Runner(suite, options.delay);
// var runner = new exports.Runner(suite, options.delay);
var runner = this.runner;
createStatsCollector(runner);
var reporter = new this._reporter(runner, options);
runner.ignoreLeaks = options.ignoreLeaks !== false;
Expand Down

0 comments on commit 2338a41

Please sign in to comment.