Created
January 6, 2012 08:04
-
-
Save polotek/1569612 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// FAILS=0 | |
// for i in tests/test-*.js; do | |
// echo $i | |
// node $i || let FAILS++ | |
// done | |
// exit $FAILS | |
var fs = require('fs') | |
, glob = require('glob') | |
, $p = require(__dirname + '/..'); | |
glob("tests/test-*.js") | |
.forEach(function (path) { | |
chain = chain ? chain.then('node', path) : $p('node', path); | |
chain.on('exit', function(code) { | |
if(code) { | |
fails++; | |
} | |
}).out(); | |
}); | |
// chain now has a pipe of all test files ready to be run sequentially | |
chain.on('exit', function() { | |
if(fails) { | |
console.error('\n' + fails + ' failed'); | |
process.exit(fails); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment