-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
35 lines (30 loc) · 876 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
35
var gulp = require('gulp'),
mocha = require('gulp-mocha'),
istanbul = require('gulp-istanbul');
//Paths to watch for changes using the watch task.
var paths = {
serverTests: [
'test/server/**/*.js'
],
serverScripts: [
'server/controllers/*.js'
]
};
function handleError(err) {
console.log(err.toString());
}
//Run the server tests and generate coverage reports
gulp.task('test:server', ['test:server:coverage'], function (done) {
gulp.src(paths.serverTests)
.pipe(mocha())
.on("error", handleError)
.pipe(istanbul.writeReports({
dir: './coverage/server',
reporters: ['lcov', 'json', 'text', 'text-summary']
}));
});
gulp.task('test:server:coverage', function () {
gulp.src(paths.serverScripts)
.pipe(istanbul())
.pipe(istanbul.hookRequire());
});