-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.js
36 lines (30 loc) · 921 Bytes
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
var gulp = require('gulp');
// Create a gulp+karma helper with a set of default options
// In this case, the options all come from the config file
var karma = require('gulp-karma')({
configFile: 'karma.conf.js'
});
// Run tests once
gulp.task('test', function() {
// Override configuration for CI, etc
return karma.once({
// reporters: ['coverage']
});
});
// WATCH OPTION 1: gulp.watch style
gulp.task('gulp-watch', function() {
// Start a server, then, once it's ready, run tests
karma.start().then(karma.run);
// Watch for changes with gulp and run tests accordingly
gulp.watch(['client/scripts/todo/*.js', 'test/client/*.js'], function() {
karma.run();
});
});
// WATCH OPTION 2: Karma autoWatch style
gulp.task('karma-watch', function() {
// Start a karma server, run tests, then watch with karma
return karma.start({
autoWatch: true
});
});
gulp.task('default', ['test']);