-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
31 lines (27 loc) · 892 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
const gulp = require('gulp');
const babel = require('gulp-babel');
const istanbul = require('gulp-babel-istanbul');
const injectModules = require('gulp-inject-modules');
const mocha = require('gulp-mocha');
const eslint = require('gulp-eslint');
gulp.task('default', ['sass', 'browserify', 'babel']);
gulp.task('lint', () =>
gulp.src(['**.js', './src/**', './test/**'])
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError())
);
gulp.task('pre-testCoverage', () => {
return gulp.src(['src/**/*.js*', '!src/index.jsx', '!src/routes.jsx'])
.pipe(istanbul({
includeUntested: true,
}))
.pipe(istanbul.hookRequire());
});
gulp.task('cover', ['pre-testCoverage'], () => {
return gulp.src(['test/**/*.js'])
.pipe(babel())
.pipe(injectModules())
.pipe(mocha({ require: ['./test/.jsdom.js'] }))
.pipe(istanbul.writeReports());
});