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 authored and dennybiasiolli committed Apr 18, 2017
1 parent 689caf8 commit fc1d3da
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 2 deletions.
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
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ node_js:
- 'node'
before_install:
- 'npm install angular pdfjs-dist'
after_success:
- bash <(curl -s https://codecov.io/bash)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# angular-pdf [![Build Status](https://travis-ci.org/sayanee/angularjs-pdf.svg)](https://travis-ci.org/sayanee/angularjs-pdf) [![Dependency Status](https://gemnasium.com/sayanee/angularjs-pdf.svg)](https://gemnasium.com/sayanee/angularjs-pdf)
# angular-pdf [![Build Status](https://travis-ci.org/sayanee/angularjs-pdf.svg)](https://travis-ci.org/sayanee/angularjs-pdf) [![Dependency Status](https://gemnasium.com/sayanee/angularjs-pdf.svg)](https://gemnasium.com/sayanee/angularjs-pdf) [![codecov](https://codecov.io/gh/sayanee/angularjs-pdf/branch/master/graph/badge.svg)](https://codecov.io/gh/sayanee/angularjs-pdf)

Version: 1.5.1

Expand Down
11 changes: 10 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,15 @@ module.exports = function(config) {
stripPrefix: 'example/',
moduleName: 'my.templates'
},
coverageReporter: {
reporters: [
{ type: 'html', subdir: '.' },
{ type: 'text' },
{ type:'lcovonly', subdir: '.'},
{ type:'json', subdir: '.' },
],
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 @@ -30,6 +30,7 @@
"babel-core": "^6.21.0",
"babel-eslint": "^7.2.2",
"babel-loader": "^6.2.10",
"babel-plugin-istanbul": "^4.1.1",
"babel-preset-latest": "^6.16.0",
"bumped": "^0.10.3",
"eslint": "^3.12.2",
Expand All @@ -41,6 +42,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 @@ -62,6 +62,9 @@ var config = {
presets: [
"latest",
],
plugins: [
"istanbul"
]
}
}
],
Expand Down

0 comments on commit fc1d3da

Please sign in to comment.