Skip to content

Commit

Permalink
Add stats object to mocha runner (#204)
Browse files Browse the repository at this point in the history
  • Loading branch information
bmomberger-bitovi authored Jun 8, 2022
1 parent df4ec95 commit 70830f7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/reporter/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
var _ = require('lodash');
var mocha = require('mocha');
var createStatsCollector = require('mocha/lib/stats-collector');
var url = require('url');
var EventEmitter = require('events').EventEmitter;
var useragent = require('useragent');
Expand Down Expand Up @@ -29,6 +30,10 @@ function Reporter(MochaReporter, coverage, root, reporterOptions) {

// The event emitter used to emit the final events
var runner = this.runner = new EventEmitter();
if (!runner.stats) {
createStatsCollector(runner);
}

// A store (by data GUID) for the Mocha objects we created.
// The handler for buffering simultaneous test runs
this.buffers = new BufferManager(runner);
Expand Down

0 comments on commit 70830f7

Please sign in to comment.