-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
gulpfile.js
35 lines (30 loc) · 891 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
var gulp = require('gulp');
var mocha = require('gulp-mocha');
var eslint = require('gulp-eslint');
var istanbul = require('gulp-istanbul');
var formatter = require('eslint-friendly-formatter');
var lint = ['gulpfile.js', 'index.js', 'utils.js'];
gulp.task('coverage', function() {
return gulp.src(lint.concat(['!gulpfile.js']))
.pipe(istanbul({
includeUntested: true
}))
.pipe(istanbul.hookRequire());
});
gulp.task('test', ['coverage'], function() {
return gulp.src('test.js')
.pipe(mocha({
reporter: 'spec'
}))
.pipe(istanbul.writeReports())
.pipe(istanbul.writeReports({
reporters: [ 'text' ],
reportOpts: {dir: 'coverage', file: 'summary.txt'}
}));
});
gulp.task('lint', function() {
return gulp.src(lint.concat(['test.js']))
.pipe(eslint())
.pipe(eslint.format(formatter));
});
gulp.task('default', ['test']);