Skip to content

Commit 978d1a3

Browse files
committed
Test coverage: browser
1 parent 9a117ca commit 978d1a3

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

generated/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@
5858
"supertest": "^0.15.0"
5959
},
6060
"devDependencies": {
61-
"gulp-istanbul": "^0.9.0"
61+
"gulp-istanbul": "^0.9.0",
62+
"karma-coverage": "^0.2.7",
63+
"karma-mocha-reporter": "^1.0.2"
6264
}
6365
}

generated/tests/browser/karma.conf.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,21 @@ module.exports = function (config) {
2323
frameworks: ['mocha', 'chai'],
2424
basePath: path.join(__dirname, '../../'),
2525
files: filesCollection,
26-
exclude: excludeFiles
26+
exclude: excludeFiles,
27+
reporters: ['mocha', 'coverage'],
28+
preprocessors: {
29+
'public/main.js': 'coverage'
30+
},
31+
coverageReporter: {
32+
dir: 'coverage/browser/',
33+
reporters: [{
34+
type: 'text',
35+
subdir: '.'
36+
}, {
37+
type: 'html',
38+
subdir: '.'
39+
}]
40+
}
2741
};
2842

2943
config.set(configObj);

0 commit comments

Comments
 (0)