-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
37 lines (32 loc) · 954 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
'use strict';
const path = require('path');
const gulp = require('gulp');
const eslint = require('gulp-eslint');
const excludeGitignore = require('gulp-exclude-gitignore');
const mocha = require('gulp-mocha');
gulp.task('static', function() {
return gulp.src('**/*.js')
.pipe(excludeGitignore())
.pipe(eslint({configFile: '.eslintrc'}))
.pipe(eslint.format())
.pipe(eslint.failAfterError());
});
gulp.task('pre-test', function() {
return gulp.src('generators/**/*.js')
.pipe(excludeGitignore());
});
gulp.task('test', ['pre-test'], function(cb) {
var mochaErr;
gulp.src('test/**/*.js')
.pipe(mocha({
reporter: 'spec',
exit:true
}))
.once('error', (err) => {
console.error(err);
});
});
gulp.task('watch', function() {
gulp.watch(['generators/**/*.js', 'test/**'], ['test']);
});
gulp.task('default', ['static', 'test']);