summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config/karma.config.js10
-rw-r--r--package.json1
2 files changed, 10 insertions, 1 deletions
diff --git a/config/karma.config.js b/config/karma.config.js
index 44229e2ee88..59b95427dbc 100644
--- a/config/karma.config.js
+++ b/config/karma.config.js
@@ -13,9 +13,17 @@ module.exports = function(config) {
{ pattern: 'spec/javascripts/fixtures/**/*@(.json|.html|.html.raw)', included: false },
],
preprocessors: {
- 'spec/javascripts/**/*.js?(.es6)': ['webpack', 'sourcemap'],
+ 'spec/javascripts/**/*.js?(.es6)': ['webpack', 'sourcemap', 'coverage'],
},
+ reporters: ['progress', 'coverage'],
webpack: webpackConfig,
webpackMiddleware: { stats: 'errors-only' },
+ coverageReporter: {
+ dir: './coverage-javascript',
+ reporters: [
+ { type: 'html', subdir: 'default' },
+ { type: 'text-summary' }
+ ],
+ }
});
};
diff --git a/package.json b/package.json
index 9581d966237..c4206eabad1 100644
--- a/package.json
+++ b/package.json
@@ -43,6 +43,7 @@
"jasmine-core": "^2.5.2",
"jasmine-jquery": "^2.1.1",
"karma": "^1.3.0",
+ "karma-coverage": "^1.1.1",
"karma-jasmine": "^1.1.0",
"karma-phantomjs-launcher": "^1.0.2",
"karma-sourcemap-loader": "^0.3.7",