-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
#7101 Not using collectCoverageFrom when in watch mode with test filtering #7153
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
Conversation
rickhanlonii
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
|
@duszans can you fix the conflict? |
|
@stipsan thoughts on this? |
rogeliog
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we add tests for this?
| if ( | ||
| globalConfig.collectCoverageFrom && | ||
| globalConfig.collectCoverageFrom.length | ||
| globalConfig.collectCoverageFrom.length && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also check for !config.watchAll?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rogeliog I don't think so - the watchAll is true when all files are watched in watch mode.
watch is true when there is some filtering applied, e.g. by test file name (at least in jest-cli/src/watch.js)
|
What will happen if you have negated patterns as well? {
"collectCoverageFrom": [
"**/*.{js,jsx}",
"!**/node_modules/**",
"!**/vendor/**"
]
}Will files from vendor suddenly show up? There is also another use case: A quick way to fix this could be to check for wether filename or testname filtering is applied in addition to the watch mode check in this PR. |
|
@stipsan Could you provide reproduction steps for what could be broke in this PR related to then related |
|
@stipsan I also checked and with these changes it works just fine (e.g. it takes |
|
Are there any other thoughts/issues to consider or can this be merged? |
Codecov Report
@@ Coverage Diff @@
## master #7153 +/- ##
=======================================
Coverage 67.31% 67.31%
=======================================
Files 248 248
Lines 9615 9615
Branches 3 4 +1
=======================================
Hits 6472 6472
Misses 3142 3142
Partials 1 1
Continue to review full report at Codecov.
|
|
Did you see @rogeliog's comment about adding a test? |
|
@duszans Awesome, thanks for taking the time to check those use cases 👍😃 |
|
@duszans mind adding a test so we can land this? |
SimenB
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing test
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
Fix for #7101
Test plan