-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
34 lines (29 loc) · 912 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
"use strict";
var gulp = require('gulp');
var nodemon = require('gulp-nodemon');
var istanbul = require('gulp-istanbul');
var mocha = require('gulp-mocha');
var jshint = require('gulp-jshint');
gulp.task('debug', function () {
nodemon({
script: 'lib/index.js',
env: { 'NODE_ENV': 'development' },
tasks: ['test']
});
});
gulp.task('coverage', ['linter'], function() {
return gulp.src(['controllers/*.js'])
.pipe(istanbul())
.pipe(istanbul.hookRequire())
});
gulp.task('test', ['coverage'], function() {
return gulp.src(['spec/**/*.js'])
.pipe(mocha())
.pipe(istanbul.writeReports())
.pipe(istanbul.enforceThresholds({ thresholds: { global: 90 } }));
});
gulp.task('linter', function() {
return gulp.src(['lib/**/*.js', 'routes/**/*.js', 'controllers/**/*.js', 'spec/**/*.js'])
.pipe(jshint())
.pipe(jshint.reporter('default'));
});