in jones-test/lib/Suite.js [81:109]
Suite.prototype.addTestsFromFile = function(fileName, onlyTests) {
var f, t, i, j, k, testList, testHash;
f = path.join(this.path, fileName);
if(onlyTests) {
onlyTests = String(onlyTests);
testList = onlyTests.split(",");
testHash = [];
for(i = 0 ; i < testList.length ; i ++) {
k = Number(testList[i]) - 1;
testHash[k] = 1;
}
}
if(re_matching_test_case.test(fileName)) {
t = require(f);
if(typeof(t.tests) === 'object' && t.tests instanceof Array) {
for(j = 0 ; j < t.tests.length ; j++) {
if(onlyTests === null || testHash[j] === 1) {
this.addTest(fileName, t.tests[j]);
}
}
}
else if(typeof(t.isTest) === 'function' && t.isTest()) {
this.addTest(fileName, t);
}
else {
console.log("Warning: " + f + " does not export a Test.");
}
}
};