chore(traceur-jasmine): accept multiple specfile globs
This commit is contained in:
parent
6c59894a29
commit
28659efa69
|
@ -7,8 +7,20 @@ var path = require('path');
|
||||||
require('traceur/bin/traceur-runtime.js');
|
require('traceur/bin/traceur-runtime.js');
|
||||||
require('reflect-metadata/Reflect');
|
require('reflect-metadata/Reflect');
|
||||||
|
|
||||||
glob(process.argv[2], function (error, specFiles) {
|
// Support passing multiple globs
|
||||||
minijasminenode2.executeSpecs({
|
var globsIndex = process.argv.indexOf('--');
|
||||||
|
var args;
|
||||||
|
if (globsIndex < 0) {
|
||||||
|
args = [process.argv[2]];
|
||||||
|
} else {
|
||||||
|
args = process.argv.slice(globsIndex + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
var specFiles = args.
|
||||||
|
map(function(globstr) { return glob.sync(globstr); }).
|
||||||
|
reduce(function(specFiles, paths) { return specFiles.concat(paths); }, []);
|
||||||
|
|
||||||
|
minijasminenode2.executeSpecs({
|
||||||
includeStackTrace: true,
|
includeStackTrace: true,
|
||||||
defaultTimeoutInterval: 1000,
|
defaultTimeoutInterval: 1000,
|
||||||
showColors: process.argv.indexOf('--no-color') === -1,
|
showColors: process.argv.indexOf('--no-color') === -1,
|
||||||
|
@ -16,5 +28,4 @@ glob(process.argv[2], function (error, specFiles) {
|
||||||
onComplete: function(passed) {
|
onComplete: function(passed) {
|
||||||
process.exit(passed ? 0 : 1);
|
process.exit(passed ? 0 : 1);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue