-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgulpfile.js
More file actions
35 lines (31 loc) · 911 Bytes
/
gulpfile.js
File metadata and controls
35 lines (31 loc) · 911 Bytes
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
'use strict';
const gulp = require('gulp');
const istanbul = require('gulp-istanbul');
const jshint = require('gulp-jshint');
const mocha = require('gulp-mocha');
gulp.task('lint', () => {
return gulp.src([
'./lib/**/*.js',
'./example/**/*.js',
'./test/**/*.js'
])
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish'))
.pipe(jshint.reporter('fail'));
});
gulp.task('test', done => {
gulp.src(['./lib/**/*.js'])
.pipe(istanbul())
.pipe(istanbul.hookRequire())
.on('finish', () => {
gulp.src(['./test/**/*.test.js'])
.pipe(mocha({
reporter: 'spec'
}))
.pipe(istanbul.writeReports({
dir: './docs/coverage'
}))
.on('end', done);
});
});
gulp.task('default', ['test']);