mirror of
https://github.com/jprichardson/node-fs-extra.git
synced 2026-01-18 16:13:55 +00:00
test.js: windows test script
This commit is contained in:
parent
96eb8a3b8e
commit
3d3f050741
@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
26
test.js
Normal file
26
test.js
Normal file
@ -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);
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user