-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
33 lines (29 loc) · 870 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
var gulp = require('gulp');
var istanbul = require('gulp-istanbul');
var jscs = require('gulp-jscs');
var jshint = require('gulp-jshint');
var mocha = require('gulp-mocha');
gulp.task('jscs', function () {
return gulp.src(['lib/**/*.js', 'bin/*'])
.pipe(jscs());
});
gulp.task('lint', function() {
return gulp.src(['lib/**/*.js', 'bin/*'])
.pipe(jshint())
.pipe(jshint.reporter('default'));
});
gulp.task('test', function (cb) {
gulp.src(['lib/**/!(*_spec).js'])
.pipe(istanbul({ includeUntested: true }))
.pipe(istanbul.hookRequire())
.on('finish', function () {
gulp.src(['lib/**/*_spec.js'])
.pipe(mocha())
.pipe(istanbul.writeReports({
dir: '.coverage',
reporters: ['html', 'text', 'lcovonly']
}))
.on('end', cb);
});
});
gulp.task('default', ['lint', 'jscs', 'test']);