Simplify test running

This commit is contained in:
Alex Dima
2018-11-28 15:10:47 +01:00
parent f8934261c0
commit 9a57732a6c
2 changed files with 5 additions and 1 deletions

View File

@@ -197,7 +197,9 @@ function main() {
} else if (argv.run) {
var tests = (typeof argv.run === 'string') ? [argv.run] : argv.run;
var modulesToLoad = tests.map(function(test) {
return path.relative(src, path.resolve(test)).replace(/(\.js)|(\.d\.ts)|(\.js\.map)$/, '');
test = test.replace(/^src/, 'out');
test = test.replace(/\.ts$/, '.js');
return path.relative(src, path.resolve(test)).replace(/(\.js)|(\.js\.map)$/, '').replace(/\\/g, '/');
});
loadFunc = cb => {
define(modulesToLoad, () => cb(null), cb);