Skip to content

Commit

Permalink
WUT
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierluigi Cau committed Mar 8, 2016
1 parent 9886ca1 commit dc8a091
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions src/test/reporter/reporterSwitch.js
@@ -1,12 +1,28 @@

// This file is loaded by mocha directly and does not support any of
// the shiny new ES6 features.

function getFiles(dir, files_) {
var fs = require("fs");
files_ = files_ || [];
var files = fs.readdirSync(dir);
for (var i in files) {
var name = dir + "/" + files[i];
if (fs.statSync(name).isDirectory()){
getFiles(name, files_);
} else {
files_.push(name);
}
}
return files_;
}

var reporter;
if (process.env.TEAMCITY_VERSION == null) {
reporter = require("../../../node_modules/mocha/lib/reporters/spec");
} else {
console.log("Using TeamCity reporter");
reporter = require("../../../node_modules/mocha-teamcity-reporter");
console.log(getFiles("./node_modules/mocha-teamcity-reporter"));
reporter = require("./node_modules/mocha-teamcity-reporter");
}
console.log("reporter", reporter);

exports = module.exports = reporter;

0 comments on commit dc8a091

Please sign in to comment.