-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.js
49 lines (42 loc) · 826 Bytes
/
test.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
43
44
45
46
47
48
49
var testrunner = require("qunit"),
walk = require("walk");
var testFile = process.argv[2],
tests = []
if (testFile){
tests.push({
"code" : {
"path" : "./lib/" + testFile,
"namespace": "testObject"
},
"tests": "./test/tests/" + testFile
});
run();
}
else {
var walker = walk.walk("./test/tests", {followLinks: false});
walker.on("file", function(root, fileStats, next){
tests.push({
"code" : {
"path" : "./lib/" + fileStats.name,
"namespace": "testObject"
},
"tests": "./test/tests/" + fileStats.name
});
next();
});
walker.on("end", function(){
run();
});
}
function run(){
testrunner.run(tests, function(err, report){
if(err){
console.error(err);
console.dir(report);
}
else{
console.log("DONE");
console.dir(report);
}
});
}