-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
33 lines (28 loc) · 911 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
var gulp = require('gulp');
var jshint = require('gulp-jshint');
var plumber = require('gulp-plumber');
var mocha = require('gulp-mocha');
var cover = require('gulp-coverage');
const eslint = require('gulp-eslint');
gulp.task('default', ['watch']);
gulp.task('watch', function () {
gulp.watch('./apps/cut/**/*.js', ['jslint', 'jstest']);
gulp.watch('./apps/spec/**/*.js', ['jstest']);
});
gulp.task('jstest', function () {
gulp.src('./apps/spec/**/*.js')
.pipe(plumber())
.pipe(cover.instrument({
pattern: ['./apps/cut/**/*.js'],
debugDirectory: 'debug'
}))
.pipe(mocha({reporter: 'nyan'}))
.pipe(cover.gather())
.pipe(cover.format())
.pipe(gulp.dest('reports'));
});
gulp.task('jslint', function () {
return gulp.src('./apps/cut/**/*.js')
.pipe(jshint())
.pipe(jshint.reporter('default'))
});