-
Notifications
You must be signed in to change notification settings - Fork 110
feat: support .vue files coverage #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@rndmerle thank you, could you sign CLA please before we can accept this PR Also, hmm, it would be nice to test this |
nice, thank you @rndmerle I really appreciate this. I will merge this feature and will create another repo with Vue example |
🎉 This PR is included in version 1.4.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
trying to get coverage for Vue components in https://github.com/bahmutov/code-coverage-vue-example - so far the reports have the wrong path, "src/components/src/components" even if the |
@bahmutov I'll check it out. Pathes are fine on our project. |
Ok I got it now. The current fix of this PR is not enough to support the sourcemaps generated by vue-loader an other loaders. To get a final working report we need:
But vue-loader (I guess) outputs this for regular components (non-Typescript classes like ours) and functional components:
Unless you have a better idea we'd need to clear |
Hi. I managed to make .vue files coverage appear in report.
The issue is the sourcemap resource path for .vue file is a crappy Webpack loaders string from vue-loader, like "cache-loader!vue-loader!file.vue?type=script,lang=ts&".
So it's needed to clean up that path before storing the coverage report.
I've been inspired by an option on karma-coverage-istanbul-reporter doing exactly this.