Skip to content

Commit

Permalink
Added browserify-istanbul as suggested on karma-runner/karma-coverage…
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiopro committed Sep 5, 2015
1 parent af35a34 commit e31ccc6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"license": "MIT",
"devDependencies": {
"brfs": "^1.4.1",
"browserify-istanbul": "^0.2.1",
"jasmine-core": "^2.3.4",
"karma": "^0.13.9",
"karma-browserify": "^4.3.0",
Expand Down
15 changes: 12 additions & 3 deletions test/karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
var istanbul = require('browserify-istanbul');

// Karma configuration
// Generated on Fri Sep 04 2015 11:20:57 GMT+0100 (IST)
module.exports = function(config) {
Expand Down Expand Up @@ -38,18 +40,25 @@ module.exports = function(config) {
// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
'../src/**/*.js' : ['coverage', 'browserify']
'../src/**/*.js' : ['browserify']
, './unit/*.js' : ['browserify']
},

coverageReporter: {
type : 'cobertura'
reporters: [
{ type: 'html' }
, { type: 'cobertura' }
]
, dir : '../coverage'
},

// using browserify-istanbul as suggested by
// https://github.com/karma-runner/karma-coverage/issues/16#issuecomment-62091196
browserify: {
debug: true
, transform: [ 'brfs' ]
, transform: [ 'brfs', istanbul({
ignore: ['**/node_modules/**', '**/test/**']
})]
},

// test results reporter to use
Expand Down

0 comments on commit e31ccc6

Please sign in to comment.