[jest] Handle Windows backslashes in preprocessor path matching #243
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Mirror of facebook/react#35358
Original author: HM-23-HM
Summary
Annotations like
//@reactVersion>= 16.9were not being handled properly by the jest preprocessor on a Windows computer. This resulted in tests running that should have been skipped.The root cause was that the relevant regular expressions in
preprocessor.jswere not matching the backslashes in Windows paths, so I updated them.How did you test this change?
I isolated some of the test cases that were running (and failing), but should have been skipped. One example is the "should handle stress test with reordering" test in the following file:
react\packages\react-devtools-shared\src\__tests__\storeStressSync-test.jswhich has the following annotations:Here's the command I used to evaluate the fix:
yarn test-build-devtools --testNamePattern="should handle stress test with reordering"Output (Before):
Output (After):