-
Notifications
You must be signed in to change notification settings - Fork 669
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
test utils coverage report broken for Vue2 projects #1977
Comments
Upgraded @vue/test-utils to 1.3.0 in repo to confirm bug persists with latest version |
I think this bug needs to be fixed in Vue Jest, since that's what instruments the code coverage for Jest. Projects definitely have code coverage working for Vue with Jest, though. I wonder if it's a config issue. |
Same issue is reported on stackoverflow. |
Reading the comments seems the issue is not here. Closing for now. |
Version
1.3.0
Reproduction link
github.com
Steps to reproduce
create a vue2 app with Jest unit testing with vue create
add
collectCoverage: true
in jest.config.jswrite a method in the HelloWorld.vue component. Do not write a unit test for it.
yarn test:unit
jest will falsely report 100% code coverage in its reporting.
What is expected?
coverage report under 100% for untested code.
What is actually happening?
While test are running and pass/failing appropriately, none of the code within the
export default{}
block of components is being counted in the code coverage report, always resulting in a 100% coverage report.The text was updated successfully, but these errors were encountered: