-
Notifications
You must be signed in to change notification settings - Fork 155
How to collect coverage from <template> section? #476
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
Comments
Yeah, this is something we'd need to implement here. It's an interesting one I haven't thought about too much; I guess in the same way we use a source map for the What exactly does coverage for HTML actually mean? If the HTML is rendered on the page, it's technically 100% covered, right? Eg - how are you expecting to measure if a line of HTML was covered? |
I understand now. We'd need to map the executed render functions, eg <div v-if="foo">BAR</div> Becomes something like import { createVNode } from 'vue'
ctx.foo === true && createVNode('div', 'BAR') Then map it back to the HTML. I have no idea if this is practical or even possible right now, seems pretty complex. Cool idea for a feature - I'm not sure I can invest the time to make this right now, but would be happy and interested to see if anyone else has some ideas. First thing I'd do is see if Angular or another framework does something similar, and how they do it. |
But it's not working even for <script> - #480 |
Currently JEST collects coverage for <script lang="ts"> section but not for section:
Is there any way to collect coverage for ?
I guess that maintainers of "jest" will not work on it.
So, maybe "vue-jest" repository is the right place to raise this question.
The text was updated successfully, but these errors were encountered: