diff --git a/package.json b/package.json index 44de504..6b61b05 100644 --- a/package.json +++ b/package.json @@ -50,6 +50,6 @@ "coverage": "istanbul cover ./node_modules/.bin/_mocha --recursive -- --reporter list", "coveralls": "npm run coverage && coveralls < coverage/lcov.info", "test": "standard && mocha test", - "test-windows": "Get-ChildItem -Path .\\test\\ -Filter *.test.js -Recurse | %{mocha $_}" + "test-windows": "node test.js" } } diff --git a/test.js b/test.js new file mode 100644 index 0000000..f834031 --- /dev/null +++ b/test.js @@ -0,0 +1,26 @@ +var Mocha = require('mocha') +var walk = require('./lib/walk/') + +var mocha = new Mocha({ + ui: 'bdd', + reporter: 'spec', + timeout: 30000, +}) + +var filter = function (item, stat) { + if (stat.isDirectory()) return true + return item.lastIndexOf('.test.js') === (item.length - '.test.js'.length) +} + +var walker = walk('./test', filter) + .on('data', function (item, stat) { + if (!stat.isFile()) return + mocha.addFile(item) + }) + .on('end', function () { + mocha.run(function(failures){ + process.exit(failures); + }) + }) + +