-
-
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
Replace path sep for testRegex in should_instrument #5560
Conversation
so test files don't get instrumented on windows given a pattern like /__tests__/*.js
if (config.testRegex && filename.match(config.testRegex)) { | ||
if ( | ||
config.testRegex && | ||
new RegExp(replacePathSepForRegex(config.testRegex)).test(filename) |
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.
Shouldn't we normalize this in normalize.js?
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.
yes please.
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.
Moved to normalize and dropped from search_source as well.
CHANGELOG.md
Outdated
### Fixes | ||
|
||
* `[jest-runtime]` Replace path sep for testRegex in should_instrument so test | ||
files don't get instrumented on windows given a pattern like /__tests__/*.js |
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.
you need to stick /__tests__/ in backticks (or escape using backslash as I've done in this comment), if not markdown looks really weird
# Conflicts: # integration-tests/__tests__/coverage_remapping.test.js
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.
This is way nicer, thanks!
Loving all the windows fixes, keep 'em coming. |
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
Test files on windows shouldn't get instrumented given a testRegex like
"/__tests__/*.js"
This matches what jest-cli does here https://github.com/facebook/jest/blob/c5fbd304c462e3c74c6cc5f5e7484e466c10521e/packages/jest-cli/src/search_source.js#L94
Test plan
Removed SkipOnWindows from the coverage_remapping integration test, which was failing for this reason, so green Appveyor.