-
Notifications
You must be signed in to change notification settings - Fork 55
/
Copy pathgulpfile.js
44 lines (35 loc) · 997 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
38
39
40
41
42
43
44
'use strict';
var gulp = require('gulp');
var $ = require('gulp-load-plugins')();
var del = require('del');
var lib = ['**/*.js', '!test/**/*', '!node_modules/**/*', '!coverage/**/*'];
function mochaStream() {
return gulp.src('test/*_test.js', {read: false})
.pipe($.mocha({
reporter: 'spec'
}));
}
gulp.task('coverage', ['clean'], function() {
return gulp.src(lib)
.pipe($.istanbul())
.pipe($.istanbul.hookRequire());
});
gulp.task('jscs', function() {
return gulp.src(lib)
.pipe($.jscs());
});
gulp.task('jshint', function() {
return gulp.src(lib)
.pipe($.jshint())
.pipe($.jshint.reporter('jshint-reporter-jscs'))
.pipe($.jshint.reporter('fail'));
});
gulp.task('mocha', ['coverage'], function() {
return mochaStream()
.pipe($.istanbul.writeReports());
});
gulp.task('mocha:nocov', function() {
return mochaStream();
});
gulp.task('clean', del.bind(null, ['test/css', 'coverage/**/*']));
gulp.task('default', ['mocha', 'jshint']);