diff --git a/karma.local.conf.js b/karma.local.conf.js index 416b438..60cc182 100644 --- a/karma.local.conf.js +++ b/karma.local.conf.js @@ -1,3 +1,5 @@ +var istanbul = require('browserify-istanbul'); + module.exports = function(config) { config.set({ //logLevel: 'LOG_DEBUG', @@ -31,7 +33,7 @@ module.exports = function(config) { exclude: [], preprocessors: { - 'src/**/*.js': ['browserify', 'coverage'], + 'src/**/*.js': ['browserify'], 'test/**/*.js': ['browserify'] }, @@ -60,7 +62,15 @@ module.exports = function(config) { // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher browsers: [ 'PhantomJS2'//, 'Firefox' - ] + ], + // using browserify-istanbul as suggested by + // https://github.com/karma-runner/karma-coverage/issues/16 + browserify: { + debug: true, + transform: [ 'brfs', istanbul({ + ignore: ['**/node_modules/**', '**/test/**'] + })] + } }); }; diff --git a/package.json b/package.json index 237798d..1b6dda1 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,8 @@ "coveralls": "^2.11.2" }, "devDependencies": { + "brfs": "^1.4.1", + "browserify-istanbul": "^0.2.1", "istanbul": "^0.3.15", "karma": "^0.12.36", "karma-browserify": "^4.0.0",