-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Make test files change trigger coverage of source code under watch mode and version control #8545
Comments
By the way, I'd love to help with this but I'm not sure where to start. In my imagination we can fix with following steps:
But I don't know how each part is handled (or not handled) in Jest. I may try to look into this in a few day. @jeysal could you guide me where the corresponding code is around the steps? Or do you have any other idea? |
@chenesan Would love to accept a contribution on this! |
Hi @jeysal , is it still good to work on this? I'd like to be back to work on this 🔨 |
Yes, afaik nothing changed regarding this. Just out of curiosity @SimenB do you know if this used to work? (see above) It seems like the obvious behavior. |
I think it worked yeah, but I'm not 100% sure. |
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. |
🚀 Feature Proposal
Make test files change trigger coverage of related source code under
--watch
and git version control.Motivation
Related to #7331 and #8491 (Not sure if it's related to any earlier issue before) . In some cases we may add tests in existed test files and want to see if the addes tests increase code coverage. However currently Jest only show coverage of changed files -- So even we have added / removed the test, we still cannot see the coverage change because source code is not changed, which is really a pain point when increasing coverage. Even though it's possible to set
forceCoverageMatch
to force jest keep an eye on specific files, it's still not so easy to use it when you're not 100% sure how many files you'd like to watch.So I propose jest should automatically track the coverage of source files that are tested by changed test files, even though it's unchanged and under vcs + watch mode.
Example
Assume you have a source file
a.js
and a test filetest.js
fora.js
. Whentest.js
changes under watch mode and vcs (or-o
), jest cli should show the coverage ofa.js
.The text was updated successfully, but these errors were encountered: