chore(traceur-jasmine): accept multiple specfile globs

This commit is contained in:
Caitlin Potter 2015-05-13 22:40:04 -04:00
parent 6c59894a29
commit 28659efa69
1 changed files with 21 additions and 10 deletions

View File

@ -7,7 +7,19 @@ 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
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({ minijasminenode2.executeSpecs({
includeStackTrace: true, includeStackTrace: true,
defaultTimeoutInterval: 1000, defaultTimeoutInterval: 1000,
@ -17,4 +29,3 @@ glob(process.argv[2], function (error, specFiles) {
process.exit(passed ? 0 : 1); process.exit(passed ? 0 : 1);
} }
}); });
});