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,14 +7,25 @@ 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('--');
includeStackTrace: true, var args;
defaultTimeoutInterval: 1000, if (globsIndex < 0) {
showColors: process.argv.indexOf('--no-color') === -1, args = [process.argv[2]];
specs: specFiles, } else {
onComplete: function(passed) { args = process.argv.slice(globsIndex + 1);
process.exit(passed ? 0 : 1); }
}
}); var specFiles = args.
map(function(globstr) { return glob.sync(globstr); }).
reduce(function(specFiles, paths) { return specFiles.concat(paths); }, []);
minijasminenode2.executeSpecs({
includeStackTrace: true,
defaultTimeoutInterval: 1000,
showColors: process.argv.indexOf('--no-color') === -1,
specs: specFiles,
onComplete: function(passed) {
process.exit(passed ? 0 : 1);
}
}); });