-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgulpfile.js
More file actions
31 lines (28 loc) · 929 Bytes
/
gulpfile.js
File metadata and controls
31 lines (28 loc) · 929 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
var gulp = require('gulp');
var jshint = require('gulp-jshint');
var mocha = require('gulp-mocha');
var cover = require('gulp-coverage');
var gutil = require('gulp-util');
// Check the code quality
gulp.task('qualitychecker', function(cb) {
return gulp.src([
'src/**/*.js',
'!test/**/*.js'])
.pipe(jshint({esversion: 6}))
.pipe(jshint.reporter('default'))
.on('error', gutil.log);
});
// run the tests (mocha) and report its code coverage
// (see the results on reports/coverage.html)
gulp.task('test', ['qualitychecker'], function () {
return gulp.src('tests/**/*.js', { read: false })
.pipe(cover.instrument({
pattern: ['lib/**/*.js'],
debugDirectory: 'debug'
}))
.pipe(mocha())
.pipe(cover.gather())
.pipe(cover.format())
.pipe(gulp.dest('reports'));
});
gulp.task('default', ['test']);