karma-coverage: Karma coverage does not show any data when using webpack + ES6
Hi
My config
module.exports = function(config) {
config.set({
browsers: ["ChromeCanary"],
coverageReporter: {
type: "html",
dir : "./docs/js-coverage"
},
files: [{
pattern: "test.bundle.js",
watched: false
}],
frameworks: ["jasmine"],
preprocessors: {
"src/main/webapp/**/*.js": "coverage",
"test.bundle.js": ["webpack"]
},
reporters: ["coverage", "dots"],
singleRun: false,
webpack: {
module: {
loaders: [{
test: /\.js/,
exclude: /node_modules/,
loader: "babel-loader?cacheDirectory&optional[]=runtime"
}]
},
watch: true
},
webpackServer: {
noInfo: true
}
});
};
test.bundle.js
var context = require.context("./src/main/webapp", true, /.+\.test\.js$/);
context.keys().forEach(context);
Tests run fine, HTML report is generated, but it contains no files in the list.
Thanks.
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Reactions: 10
- Comments: 19 (1 by maintainers)
Commits related to this issue
- Karma set up except for this bug https://github.com/karma-runner/karma-coverage/issues/184 — committed to naomiaro/waveform-playlist by naomiaro 9 years ago
- chore(coverage): Remove test coverage Because of https://github.com/karma-runner/karma-coverage/issues/184 — committed to egoroof/browser-id3-writer by egoroof 8 years ago
Was not able to get coverage information with webpack (2) and karma-coverage. Had to use both “istanbul-instrumenter-loader” as a webpack file loader for test run and “karma-coverage-istanbul-reporter” as coverage reporter and after couple of days of struggles it worked.
coverage sourcemap not work. only index.js.

no filelists, can you help me?
I have the same problem. I thought I did something wrong, but whatever I try, it just comes up with zero files in the generated HTML. Is this a bug?
Edit: I fixed this by adding isparta preloaders to the webpack.module:
Hi, I found an alternative. Use Isparta loader in your karma conf file.
Don’t forget to require karma-coverage and add it in preprocessors.
I hope it will help you.