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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

not able to run the coverage for one file on jest 26.6.3 #10815

Closed
acostaf opened this issue Nov 13, 2020 · 3 comments
Closed

not able to run the coverage for one file on jest 26.6.3 #10815

acostaf opened this issue Nov 13, 2020 · 3 comments

Comments

@acostaf
Copy link

acostaf commented Nov 13, 2020

馃悰 Bug Report

not able to run the coverage for one file please see #7427

To Reproduce

yarn jest src/components/MyComponent/MyComponent.test.tsx --coverage --collectCoverageOnlyFrom=src/components/MyComponent/MyComponent.tsx

Expected behavior

Display test result and coverage for a single file on screen, just for MyComponent.tsx

@acostaf
Copy link
Author

acostaf commented Nov 13, 2020

Hi All, I found a possible answer for this issues, my team move jest from version 23 to 26.6.3 at the time collectCoverageOnlyFrom was working fine but started to display untested files on the coverage report as soon as we move to the newer version, now the problem is related with how cache is manage, so adding a --no-cache after collectCoverageOnlyFrom solve it for me

@SimenB
Copy link
Member

SimenB commented Nov 14, 2020

Please include a reproduction in bug reports: https://stackoverflow.com/help/minimal-reproducible-example.

@SimenB SimenB closed this as completed Nov 14, 2020
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants