-
Notifications
You must be signed in to change notification settings - Fork 178
/
Copy pathgulpfile.js
37 lines (31 loc) · 885 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
37
var gulp = require('gulp'),
eslint = require('gulp-eslint'),
jshint = require('gulp-jshint'),
mocha = require('gulp-mocha');
// ESLint JS linting task
gulp.task('eslint', function () {
return gulp
.src(['./app/**/*', './test/**/*', '!./test/temp'])
.pipe(eslint())
.pipe(eslint.format());
});
// JS linting task
gulp.task('jshint', function () {
return gulp
.src(['./app/**/*', './test/**/*', '!./test/temp'])
.pipe(jshint())
.pipe(jshint.reporter('default'))
.pipe(jshint.reporter('fail'));
});
gulp.task('lint', gulp.parallel('eslint', 'jshint'));
// Mocha test task
gulp.task('mocha', function () {
return gulp
.src(['./test/**/*', '!./test/temp'])
.pipe(mocha({
reporter: 'spec'
}));
});
gulp.task('test', gulp.series('mocha', 'lint'));
// The default task (called when you run `gulp` from cli)
gulp.task('default');