diff --git a/.gitignore b/.gitignore index 32c57f2..2d3dc70 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .idea +coverage node_modules server/datasources.local.json server/model-config.local.json \ No newline at end of file diff --git a/karma.conf.js b/karma.conf.js index 6db143d..8917667 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -1,6 +1,8 @@ // Karma configuration // Generated on Sun Jan 18 2015 21:07:20 GMT-0800 (PST) +var istanbul = require('browserify-istanbul'); + module.exports = function(config) { config.set({ @@ -32,7 +34,9 @@ module.exports = function(config) { browserify: { debug: true, - transform: ['brfs'], + transform: ['brfs', istanbul({ + ignore: ['**/node_modules/**', '**/spec/**'], + })], bundleDelay: 1000 }, @@ -40,7 +44,15 @@ module.exports = function(config) { // test results reporter to use // possible values: 'dots', 'progress' // available reporters: https://npmjs.org/browse/keyword/karma-reporter - reporters: ['dots'], + reporters: ['coverage', 'dots'], + + + coverageReporter: { + reporters: [ + {type: 'html'}, + {type: 'cobertura'}, + ], + }, // web server port diff --git a/package.json b/package.json index 48f4df2..fb77302 100644 --- a/package.json +++ b/package.json @@ -39,6 +39,7 @@ "loopback-explorer": "^1.1.0" }, "devDependencies": { + "browserify-istanbul": "^0.1.5", "frisby": "git+https://github.com/vlucas/frisby.git", "gulp": "^3.8.10", "gulp-develop-server": "^0.2.5", @@ -52,6 +53,7 @@ "karma": "^0.12.31", "karma-browserify": "^2.0.0", "karma-chrome-launcher": "^0.1.7", + "karma-coverage": "^0.2.6", "karma-jasmine": "^0.3.5", "strongloop": "^2.10.2" }