-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
25 lines (23 loc) · 867 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
var gulp = require('gulp');
var istanbul = require('gulp-istanbul');
var jasmine = require('gulp-jasmine');
var coveralls = require('gulp-coveralls');
gulp.task('test', function (cb) {
gulp.src([
'src/app.js',
'src/routes/*.js'
])
.pipe(istanbul({includeUntested: true})) // Covering files
.pipe(istanbul.hookRequire()) // Force `require` to return covered files
.on('finish', function() {
gulp.src(['spec/AppSpec.js'])
.pipe(jasmine())
.pipe(istanbul.writeReports()) // Creating the reports after tests ran
// .pipe(istanbul.enforceThresholds({ thresholds: { global: 70 } })) // Enforce a coverage of at least 90%
.on('end', cb);
})
});
gulp.task('coveralls', ['test'], function(cb) {
gulp.src('./coverage/lcov.info')
.pipe(coveralls());
});