mirror of https://github.com/n2geoff/testit.git
added sample node test runner
This commit is contained in:
parent
3fa74a2bf3
commit
22a49b4a75
|
@ -0,0 +1,24 @@
|
||||||
|
var path = require("path");
|
||||||
|
var fs = require("fs");
|
||||||
|
|
||||||
|
fs.readdir(__dirname, function(err, files) {
|
||||||
|
if(err) {
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
var tests = files.filter(function(item) {
|
||||||
|
return item.indexOf("spec.js") !== -1;
|
||||||
|
});
|
||||||
|
|
||||||
|
tests.forEach(function(file) {
|
||||||
|
|
||||||
|
console.log(`: ${file}`);
|
||||||
|
|
||||||
|
var me = fs.readFileSync(path.join(__dirname, file))
|
||||||
|
|
||||||
|
// eval maybe evil, but its your code, are you evil?
|
||||||
|
eval(me.toString());
|
||||||
|
|
||||||
|
test.run();
|
||||||
|
});
|
||||||
|
});
|
Loading…
Reference in New Issue