ES6 + Rollup + Karma Coverage
Hi Developers, i am looking for a nice tutorial / example project where Rollup, ES6, Karma and Karma Coverage is used. I try to get the coverage reporting working. Test execution with QUnit and Karma works, only the coverage reporting is not working. Do you any useful links?
Long time ago. However, here is an example how I got it work https://github.com/flovogt/es6-rollup-karma-coverage
I was struggling with this too and finally got it to work with a different approach. Now that it's set up, it seems simple/straightforward, but it took longer than I'd like to admit to get the pieces placed correctly.
My solution is up at https://github.com/oyejorge/rollup-karma-coverage
Thanks @oyejorge for sharing your alternative approach.
Only to highlight the difference: Your solution are using the bundled files for test executing in the karma config, isn't it? In the first sample karma uses the source files so no build is needed.
Right. The build is done as normal with rollup npm run build and doesn't have to be defined inside of karma.conf.js at all.
When running npm test, the build is automatically created first via the pretest entry in package.json.