From 22a49b4a75ce700352d170797f73599ee4abc39c Mon Sep 17 00:00:00 2001 From: Geoff Doty Date: Wed, 6 Jun 2018 08:03:45 -0400 Subject: [PATCH] added sample node test runner --- test/run.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 test/run.js diff --git a/test/run.js b/test/run.js new file mode 100644 index 0000000..5c7dcc8 --- /dev/null +++ b/test/run.js @@ -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(); + }); +});