-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
gulpfile.js
33 lines (27 loc) · 831 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
'use strict';
var gulp = require('gulp');
var mocha = require('gulp-mocha');
var istanbul = require('gulp-istanbul');
var unused = require('gulp-unused');
var eslint = require('gulp-eslint');
gulp.task('coverage', function() {
return gulp.src(['index.js', 'lib/*.js'])
.pipe(istanbul())
.pipe(istanbul.hookRequire());
});
gulp.task('test', ['coverage'], function() {
return gulp.src('test/test.js')
.pipe(mocha({reporter: 'spec'}))
.pipe(istanbul.writeReports());
});
gulp.task('lint', function() {
return gulp.src(['*.js', 'test.js', 'lib/*.js'])
.pipe(eslint())
.pipe(eslint.format());
});
gulp.task('unused', function() {
var keys = Object.keys(require('./lib/utils.js'));
return gulp.src(['*.js', 'lib/*.js'])
.pipe(unused({keys: keys}));
});
gulp.task('default', ['test', 'lint']);