Skip to content
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

Closed
MikeOverbeck opened this issue May 28, 2022 · 5 comments
Closed

test utils coverage report broken for Vue2 projects #1977

MikeOverbeck opened this issue May 28, 2022 · 5 comments

Comments

@MikeOverbeck
Copy link

MikeOverbeck commented May 28, 2022

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.js
write 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.


@MikeOverbeck
Copy link
Author

Upgraded @vue/test-utils to 1.3.0 in repo to confirm bug persists with latest version

@lmiller1990
Copy link
Member

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.

@1amardeep
Copy link

@cpontvieux-systra
Copy link

vuejs/vue-jest#480

@ebisbe
Copy link
Collaborator

ebisbe commented Jan 20, 2023

vuejs/vue-jest#480

Reading the comments seems the issue is not here. Closing for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants