-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add C8 Coverage support for Vue template logic #751
Comments
Template coverage is already working and is trying to mark Problem is Vite sourcemaps. Not sure if this is the issue with Vite itself or Vue plugin. @patak-dev Is there a way to investigate Vite sourcemaps after each plugin? Something like https://github.com/antfu/vite-plugin-inspect but for sourcemaps? |
@JessicaSachs Vite PR created. |
Fixed in update: Not fixed yet :) |
There was an issue while publishing, it will be fixed when we solve it |
Publishing issue is fixed, solved in https://www.npmjs.com/package/@vitejs/plugin-vue/v/2.2.2 |
So cool! I can't wait to give it a try. |
@JessicaSachs did you try it? @Demivan I'm seeing different results just by swapping C8 and Istanbul. "@vitejs/plugin-vue": "^3.1.2", I'm seeing different results as well with different tests. For now I'll stick with Istanbul as it's the accurate one. |
@ebisbe Tried your example with c8. Seems to be working correctly. |
@Demivan I was thinking something like that might happen. I'll review this afternoon removing plugins. |
The issue is with @antfu |
hello @Demivan @patak-dev . understand that this issue has been closed. however, i am facing a similar issue where the here are the dependencies versions:
the
a test has been written to check that
however, the coverage on is this an expected or known behaviour? I have created a minimally reproducible repo and it can be found here. also, using |
Clear and concise description of the problem
Currently, there's no support for reporting coverage of SFC files where the logic is performed in the template instead of the script block.
For example, in a test, if you mount this component with prop
msg
, the run will show 100% coverage, even though line No. 11 is not covered.HelloWorld.spec.ts
Logic in template
Logic in script
When you refactor the file to pull the logic into the script tag instead of the template, the coverage report correctly reports the uncovered lines of code.
Missing coverage
Suggested solution
No idea. Jest + Istanbul doesn't solve this either.
Alternative
No response
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: