Skip to content

Commit

Permalink
build: fix test:watch task
Browse files Browse the repository at this point in the history
  • Loading branch information
hsuanxyz committed Jun 17, 2019
1 parent c31f315 commit a51e993
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion components/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ if (tags) {
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// Filter specify file
const specFiles = context.keys().filter((path: string) => filterRegExp.test(path));
const specFiles = context.keys().filter((path: string) => {
console.log(filterRegExp);
return filterRegExp.test(path);
});
// And load the modules.
specFiles.map(context);
6 changes: 5 additions & 1 deletion scripts/gulp/tasks/unit-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@ import { execTask } from '../util/task-helpers';

task('test:watch', (done) => {
const argv = require('minimist')(process.argv.slice(2));
let tags = '';
if (argv.tags && typeof argv.tags === 'string') {
tags = argv.tags;
}
return execTask(
'ng',
['test', '--watch=true', '--code-coverage'],
{
'NG_TEST_TAGS': argv.tags || ''
'NG_TEST_TAGS': tags
}
)(done);
});

0 comments on commit a51e993

Please sign in to comment.