Description
I have Jest setup to test files with @vue/vue3-jest
and it runs all of the Vue tests just fine, however I came across a peculiar issue regarding test coverage - it was going down in our CI dashboard as I was testing more components.
SFC Vue files without a *.spec.js
test show up in the Jest coverage summary with zero coverage as expected. After adding a *.spec.js
for a component, it will no longer collect or be listed in the coverage summary in our project.
Regular JavaScript files are unaffected and report coverage as expected.
I have a demo repository setup, however it only partially reproduces our issue - @components/Demo.vue
is missing, but the two components in @components/demo/
show up fine (which doesn't happen in our project). Removing the @components/Demo.spec.js
makes it show up again with zero coverage.
Demo: https://github.com/wopian/jest-coverage-demo
Demo moved to PR: #423
With Demo.spec.js, coverage unreported
With Demo.spec.js.old, (zero) coverage reported
vue: ^3.2.23
jest: ^27.3.1
@vue/vue3-jest: ^27.0.0-alpha.4