Skip to content

Commit

Permalink
Merge 2b33962 into 807dfa1
Browse files Browse the repository at this point in the history
  • Loading branch information
YOU54F committed May 5, 2019
2 parents 807dfa1 + 2b33962 commit 0a7c864
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
Empty file removed .npmignore
Empty file.
24 changes: 24 additions & 0 deletions lib/MultiReporters.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,31 @@ var mocha = require('mocha');
var Base = mocha.reporters.Base;
var path = require('path');

var createStatsCollector;
var mocha6plus;

try {
var json = JSON.parse(
fs.readFileSync("./node_modules/mocha/package.json", "utf8")
);
version = json.version;
if (version >= "6") {
createStatsCollector = require("mocha/lib/stats-collector");
mocha6plus = true;
}
else {
mocha6plus = false;
}
}
catch (e) {
console.warn("Couldn't determine Mocha version");
}

function MultiReporters(runner, options) {
if (mocha6plus) {
createStatsCollector(runner);
}

Base.call(this, runner);

if (_.get(options, 'execute', true)) {
Expand Down

0 comments on commit 0a7c864

Please sign in to comment.