-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
65 lines (52 loc) · 1.23 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
'use strict';
var
del = require('del'),
gulp = require('gulp'),
istanbul = require('gulp-istanbul'),
jshint = require('gulp-jshint'),
mocha = require('gulp-mocha'),
sequence = require('run-sequence');
gulp.task('clean', function (callback) {
return del(['coverage'], callback);
});
gulp.task('jshint', function () {
return gulp
.src(['lib/**/*.js', 'test/**/*.js'])
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish'));
});
gulp.task('test-all', function (callback) {
sequence('clean', 'jshint', 'test-coverage', callback);
});
gulp.task('test-coverage', ['clean'], function () {
return gulp
.src(['./lib/**/*.js'])
.pipe(istanbul())
.pipe(istanbul.hookRequire())
.on('finish', function () {
gulp
.src(['./test/lib/**/*.js'])
.pipe(mocha({
reporter : 'spec'
}))
.pipe(istanbul.writeReports('./reports'));
});
});
gulp.task('test-functional', function () {
return gulp
.src(['./test/functional/**/*.js'], { read : false })
.pipe(mocha({
checkLeaks : true,
reporter : 'spec',
ui : 'bdd'
}));
});
gulp.task('test-unit', function () {
return gulp
.src(['./test/lib/**/*.js'], { read : false })
.pipe(mocha({
checkLeaks : true,
reporter : 'spec',
ui : 'bdd'
}));
});