Skip to content

Commit 08e5ece

Browse files
author
Walker Leite
committed
feat(gulp): add optional -t parameter to test files
1 parent c64e3e5 commit 08e5ece

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

template/gulp-tasks/test.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@ import gulp from 'gulp';
22
import mocha from 'gulp-mocha';
33
import {Server} from 'karma';
44
import path from 'path';
5+
import {argv} from 'yargs';
56
import {dirs} from './config';
67

78
gulp.task(
89
'test:server',
910
() =>
10-
gulp.src(path.resolve(dirs.testServer, '**/*.spec.js'))
11+
gulp.src(argv.t || path.resolve(dirs.testServer, '**/*.spec.js'))
1112
.pipe(mocha({
1213
compilers: 'js:babel-core/register',
1314
require: path.resolve(dirs.test, 'mocha.conf.js'),
@@ -16,7 +17,7 @@ gulp.task(
1617

1718
gulp.task('test:client', (done) => {
1819
new Server({
19-
files: [path.resolve(dirs.testClient, '**/*.spec.js')],
20+
files: [argv.t || path.resolve(dirs.testClient, '**/*.spec.js')],
2021
configFile: path.resolve(dirs.test, 'karma.conf.js'),
2122
singleRun: true,
2223
}, done).start();

0 commit comments

Comments
 (0)