Skip to content

Commit 9a117ca

Browse files
committed
Test coverage: server
1 parent 7d3da5f commit 9a117ca

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ generated/public
55
node_modules
66
bower_components
77
npm-debug.log
8-
.DS_Store
8+
.DS_Store
9+
coverage/

generated/gulpfile.js

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ var sourcemaps = require('gulp-sourcemaps');
1616
var jshint = require('gulp-jshint');
1717
var mocha = require('gulp-mocha');
1818
var karma = require('karma').server;
19+
var istanbul = require('gulp-istanbul');
1920

2021
// Development tasks
2122
// --------------------------------------------------------------
@@ -45,9 +46,21 @@ gulp.task('buildJS', function () {
4546
.pipe(gulp.dest('./public'));
4647
});
4748

48-
gulp.task('testServerJS', function () {
49-
return gulp.src('./tests/server/**/*.js', {read: false})
50-
.pipe(mocha({reporter: 'spec'}));
49+
gulp.task('testServerJS', function (done) {
50+
gulp.src('./server/**/*.js')
51+
.pipe(istanbul({
52+
includeUntested: true
53+
}))
54+
.pipe(istanbul.hookRequire())
55+
.on('finish', function () {
56+
gulp.src('./tests/server/**/*.js', {read: false})
57+
.pipe(mocha({reporter: 'spec'}))
58+
.pipe(istanbul.writeReports({
59+
dir: './coverage/server/',
60+
reporters: ['html', 'text']
61+
}))
62+
.on('end', done);
63+
});
5164
});
5265

5366
gulp.task('testBrowserJS', function (done) {

0 commit comments

Comments
 (0)