-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrunner.js
executable file
·43 lines (33 loc) · 938 Bytes
/
runner.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env node
var search = require("./search");
var optimist = require("optimist");
var Suite = require("./jasminum");
var Reporter = require("./reporter");
var argv = optimist
.boolean(["p", "passes"])
.boolean(["f", "failures"])
.argv;
Error.stackTraceLimit = Infinity;
search(argv._).then(function (files) {
var suite = new Suite("").describe(function () {
files.forEach(function (file) {
describe(file, function () {
if (process.stdout.isTTY) {
console.log(file.grey);
} else {
console.log(file);
}
require(file);
});
});
});
var options = {
showFails: argv.f || argv.failures,
showPasses: argv.p || argv.passes
};
var report = new Reporter(options);
return suite.runAndReport({
report: report
});
})
.done();