-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathgulpfile.js
69 lines (63 loc) · 1.52 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
66
67
68
69
// Mocha test example
require('gulp').task('mocha_tests', require('./index').createTask({
src: ['test/test1.js', 'test/test2.jsx'],
istanbul: {
exclude: /node_modules|test[0-9]/
},
coverage: {
reporters: ['text', 'json', 'lcov'],
directory: 'coverage'
},
mocha: {
reporter: 'spec'
}
}));
// Jasmine test example
var gulp = require('gulp');
var jasmine = require('gulp-jasmine');
var GJC = require('./index');
gulp.task('mocha_emitext_tests', GJC.createTask({
src: ['test/test3.jsx'],
istanbul: {
exclude: /node_modules|test[0-9]/
},
babel: {
include: /\.jsx$/,
omitExt: ['.jsx']
},
coverage: {
reporters: ['text', 'lcov'],
directory: 'coverage2'
}
}));
gulp.task('mocha_cover_all_tests', GJC.createTask({
src: ['test/*', '!test/test3.jsx', '!test/test2.jsx'],
coverage: {
reporters: ['text', 'lcov'],
directory: 'coverage3'
}
}));
gulp.task('jasmine_tests', function () {
GJC.initModuleLoader({});
return gulp.src(['test/test4.js', 'test/test5.jsx'])
.pipe(jasmine())
.on('end', GJC.collectIstanbulCoverage({
coverage: {
reporters: ['text', 'lcov'],
directory: 'coverage4'
}
}));
});
gulp.task('mocha_threshold_tests', GJC.createTask({
src: ['test/test1.js'],
threshold: [
{
type: 'lines',
min: 70
},
{
type: 'functions',
min: 90
}
]
}));