vuejs / vue-jest

Jest Vue transformer
MIT License
746 stars 157 forks source link

Coverage is not counted when use JSX tag #372

Open simpletrontdip opened 3 years ago

simpletrontdip commented 3 years ago

Hi! I'm not really sure how to Google correctly around this, I can not find the answer out there, so I post it here, with the hope that I can get some hints.

I'm building a component for Vue 3, when I use JSX instead of h, it shows that branch is not covered

// JSX, coverage is not counted
return <Component {...attr}>{slots}</Component>

// normal h tag, coverage is counted
return h(Component, attrs, slot)
Screen Shot 2021-08-04 at 15 29 54 Screen Shot 2021-08-04 at 15 32 48

Is there any option I can try to resolve this? If this is a bug, please let me know, I will create a repo for reproduction.