jest-haste-map: fix bug where platform-specific files are removed#5534
jest-haste-map: fix bug where platform-specific files are removed#5534
Conversation
fc0971c to
c6055a9
Compare
|
Great stuff, missing a changelog 😄 |
|
The linter ( I added the line to the changelog. I've got bad habits ahah, I already made a few fixes before that weren't added to the changelog. |
Codecov Report
@@ Coverage Diff @@
## master #5534 +/- ##
=========================================
Coverage ? 61.71%
=========================================
Files ? 213
Lines ? 7149
Branches ? 4
=========================================
Hits ? 4412
Misses ? 2736
Partials ? 1
Continue to review full report at Codecov.
|
|
Nice, thanks for fixing this. Re the prettier issue: I wanted to fix it this morning but got carried away and forgot. |
|
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. |
Another fix for
jest-haste-map😁This changeset fixes the bug that was reproduced by the test I added a few days ago, where platform-specific file removals aren't taken into account. I traced this back to the fact the logic just copies the entire module metadata for a particular Haste name, without discriminating between platforms. That means if any of the files for that Haste name is still here, all the platforms already cached are included in the new map, even if some of these files were deleted. With the new logic, we only copy over the data for the platform of the file being processed.
I didn't check how that behaves for the watch mode but I suspect this fixes the bug for it as well. I can follow up with another test for that.