Skip to content

Commit

Permalink
karma: add coverage
Browse files Browse the repository at this point in the history
Generate code coverage using Istanbul
  • Loading branch information
simobasso committed Jan 5, 2017
1 parent 12acecc commit 9f11fa2
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.DS_Store
node_modules
bower_components
coverage
9 changes: 8 additions & 1 deletion karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ module.exports = function(config) {
// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['progress'],
reporters: ['progress', 'coverage'],


// web server port
Expand Down Expand Up @@ -82,6 +82,13 @@ module.exports = function(config) {
stripPrefix: 'example/',
moduleName: 'my.templates'
},
coverageReporter: {
reporters: [
{ type: 'html', subdir: '.' },
{ type: 'text' },
],
dir : 'coverage/'
},
webpack: webpackConfig,

webpackMiddleware: {
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"babel-core": "^6.21.0",
"babel-eslint": "^7.1.1",
"babel-loader": "^6.2.10",
"babel-plugin-istanbul": "^3.0.0",
"babel-preset-latest": "^6.16.0",
"bumped": "^0.10.3",
"eslint": "^3.12.2",
Expand All @@ -43,6 +44,7 @@
"jscs": "~3.0.5",
"jscs-loader": "^0.3.0",
"karma": "^1.3.0",
"karma-coverage": "^1.1.1",
"karma-jasmine": "^1.1.0",
"karma-ng-html2js-preprocessor": "^1.0.0",
"karma-phantomjs-launcher": "^1.0.2",
Expand Down
3 changes: 3 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ var config = {
presets: [
"latest",
],
plugins: [
"istanbul"
]
}
}
],
Expand Down

0 comments on commit 9f11fa2

Please sign in to comment.