Skip to content

Commit 4a5e02b

Browse files
committed
refactor(gulp): migrate mocha settings to lazypipe
lift mocha settings to a lazypipe for reuse and update test globs to separate unit and integration server tests
1 parent 0cb4a4b commit 4a5e02b

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

Diff for: app/templates/gulpfile.babel(gulp).js

+7-8
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,12 @@ const paths = {
3838
bower: `${clientPath}/bower_components/`
3939
},
4040
server: {
41-
scripts: [`${serverPath}/**/*.<%= scriptExt %>`],
41+
scripts: [`${serverPath}/**/!(*.spec|*.integration).<%= scriptExt %>`],
4242
json: [`${serverPath}/**/*.json`],
43-
test: [
44-
`${serverPath}/**/*.spec.js`,
45-
`${serverPath}/**/*.mock.js`,
46-
`${serverPath}/**/*.integration.js`
47-
]
43+
test: {
44+
integration: `${serverPath}/**/*.integration.js`,
45+
unit: `${serverPath}/**/*.spec.js`
46+
}
4847
},
4948
karma: 'karma.conf.js',
5049
dist: 'dist'
@@ -318,7 +317,7 @@ gulp.task('start:server', () => {
318317
});
319318

320319
gulp.task('watch', () => {
321-
var testFiles = _.union(paths.client.test, paths.server.test);
320+
var testFiles = _.union(paths.client.test, paths.server.test.unit, paths.server.test.integration);
322321

323322
plugins.livereload.listen();
324323

@@ -383,7 +382,7 @@ gulp.task('test:server', cb => {
383382
});
384383

385384
gulp.task('mocha:unit', () => {
386-
return gulp.src(paths.server.test)
385+
return gulp.src(paths.server.test.unit)
387386
.pipe(mocha());
388387
});
389388

0 commit comments

Comments
 (0)