-
Notifications
You must be signed in to change notification settings - Fork 9
/
gulpfile.js
34 lines (31 loc) · 895 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
var gulp = require('gulp');
var mocha = require('gulp-mocha');
var stripDebug = require('gulp-strip-debug');
var gutil = require('gulp-util');
var cover = require('gulp-coverage');
gutil.log = gutil.noop;
gulp.task('test', function() {
gulp.src('test/default.spec.js')
.pipe(stripDebug())
.pipe(mocha({
reporter: 'html-cov',
clearRequireCache: true,
ignoreLeaks: true
}));
});
gulp.task('coverage', function() {
return gulp.src(['./slushfile.js', './tasks/*.js'], {
read: false
})
.pipe(cover.instrument({
pattern: ['./test/*.spec.js'],
debugDirectory: 'debug'
}))
.pipe(mocha({
reporter: 'html-cov',
ignoreLeaks: true
}))
.pipe(cover.gather())
.pipe(cover.format())
.pipe(gulp.dest('reports'));
});