-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
49 lines (42 loc) · 1.32 KB
/
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
45
46
47
48
49
'use strict';
/*global jasmine:true */
var
clean = require('./lib/clean'),
middle = require('@whitneyit/middle'),
gulp = require('gulp'),
eslint = require('gulp-eslint'),
istanbul = require('gulp-istanbul'),
jasmine = require('gulp-jasmine'),
jscs = require('gulp-jscs'),
serve = require('gulp-serve');
gulp.task('clean:coverage', function (done) {
clean('coverage', done);
});
gulp.task('lint', function () {
return gulp.src(['gulpfile.js', 'index.js', 'lib/**/*.js', 'tests/**/*.js'])
.pipe(eslint())
.pipe(eslint.format())
.pipe(jscs());
});
gulp.task('serve:coverage', serve({
'middleware' : middle('coverage'),
'port' : 3333,
'root' : 'coverage'
}));
gulp.task('test', ['clean:coverage'], function (done) {
gulp.src(['lib/**/*.js'])
.pipe(istanbul({
'includeUntested' : true
}))
.pipe(istanbul.hookRequire())
.on('finish', function () {
gulp.src(['tests/specs/**/*.spec.js'])
.pipe(jasmine())
.pipe(istanbul.writeReports({
'dir' : 'coverage/lcov',
'reporters' : ['lcov', 'text-summary']
}))
.on('end', done);
});
});
gulp.task('default', ['lint', 'test']);