From 24bd8d1908a53dd37bbc5c9a3e4d0693fc231347 Mon Sep 17 00:00:00 2001 From: David Kaltschmidt Date: Tue, 16 Jun 2015 15:41:27 +0200 Subject: [PATCH] use karma-coverage and istanbul --- .../app/scripts/stores/__tests__/app-store-test.js | 1 - client/package.json | 2 ++ client/test/karma.conf.js | 13 ++++++++++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/client/app/scripts/stores/__tests__/app-store-test.js b/client/app/scripts/stores/__tests__/app-store-test.js index 7ca3c6668..4191e6a1c 100644 --- a/client/app/scripts/stores/__tests__/app-store-test.js +++ b/client/app/scripts/stores/__tests__/app-store-test.js @@ -128,7 +128,6 @@ describe('AppStore', function() { registeredCallback(RouteAction); expect(AppStore.getSelectedNodeId()).toBe(null); expect(AppStore.getNodes()).toEqual(NODE_SET); - }); diff --git a/client/package.json b/client/package.json index 72669ceab..57820cd15 100644 --- a/client/package.json +++ b/client/package.json @@ -48,9 +48,11 @@ "gulp-preprocess": "^1.2.0", "gulp-size": "^1.2.1", "gulp-util": "^3.0.4", + "istanbul-instrumenter-loader": "^0.1.3", "jasmine-core": "^2.3.4", "karma": "^0.12.33", "karma-cli": "0.0.4", + "karma-coverage": "^0.4.2", "karma-jasmine": "^0.3.5", "karma-phantomjs-launcher": "^0.1.4", "karma-webpack": "^1.5.1", diff --git a/client/test/karma.conf.js b/client/test/karma.conf.js index 004e03a5a..1d1a39905 100644 --- a/client/test/karma.conf.js +++ b/client/test/karma.conf.js @@ -16,8 +16,12 @@ module.exports = function(config) { 'tests.webpack.js': ['webpack'] }, reporters: [ - 'dots' + 'dots', + 'coverage' ], + coverageReporter: { + type: 'text-summary' + }, webpack: { module: { loaders: [ @@ -26,6 +30,13 @@ module.exports = function(config) { exclude: /node_modules/, loader: 'babel-loader' } + ], + postLoaders: [ + { + test: /\.js$/, + exclude: /(test|node_modules|bower_components)\//, + loader: 'istanbul-instrumenter' + } ] }, watch: true