Karma coverage does not show any data when using webpack + ES6
See original GitHub issueHi
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.
Issue Analytics
- State:
- Created 8 years ago
- Reactions:10
- Comments:19 (1 by maintainers)
Top Results From Across the Web
Karma Coverage not picking up everything using Webpack
The problem is I have other files inside of the src/ folder that it doesn't seem to be detecting. For example I have...
Read more >ES6, Webpack, Karma, and Code Coverage - YouTube
These days it's best to just use Jest and be done with it...**I gave this talk at UtahJS June 16th, ...
Read more >ES6, Webpack, Karma, and Code Coverage by Kent C. Dodds
Setting up test coverage reporting with ES6 and Karma. ... Kent will show you what you can do to stay in front of...
Read more >Natively Unit-Testing ES6 Modules in Browser Including ...
You can control this when invoking karma using option --single-run or --no-single-run. preprocessors usually integrate transpilers. Code ...
Read more >istanbul-instrumenter-loader - webpack - JS.ORG
karma-webpack · karma-coverage-istanbul-reporter ... create a code coverage report for all components (even for those for which you have no ... with Babel....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.
![image](https://user-images.githubusercontent.com/6869168/33238392-b0d05c1c-d2c7-11e7-8aad-7922935627cb.png)
no filelists, can you help me?