Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Pierluigi Cau
committed
Mar 8, 2016
1 parent
9886ca1
commit dc8a091
Showing
1 changed file
with
19 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; |