Skip to content
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

Fix duplicate module detection #7333

Merged
merged 2 commits into from Nov 7, 2018

Conversation

rubennorte
Copy link
Contributor

Summary

Some code in the haste map checked if the module ID changed to determine if the file should be rechecked for duplication or not. The module ID isn't available at that point (it's extracted later from the filename) so it was returning all the files all the time.

Also improved the data structure used to store those deprecated files to remove the number of newly allocated objects.

Test plan

Updated tests.

@rubennorte rubennorte force-pushed the fix-duplicate-module-detection branch from f5321bf to 1f7cc58 Compare November 6, 2018 22:35
@rubennorte rubennorte force-pushed the fix-duplicate-module-detection branch from 1f7cc58 to 8f099fd Compare November 7, 2018 16:45
@rubennorte rubennorte force-pushed the fix-duplicate-module-detection branch from 8f099fd to a2e45e8 Compare November 7, 2018 17:00
@@ -108,18 +108,25 @@ const object = data => Object.assign(Object.create(null), data);
const createMap = obj => new Map(Object.keys(obj).map(key => [key, obj[key]]));

// Jest toEqual does not match Map instances from different contexts
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mjesun do you think we should fix this in Jest matchers? Given it's a very unfrequent use case we might just use this solution.

@rubennorte rubennorte merged commit 2b18a26 into jestjs:master Nov 7, 2018
@rubennorte rubennorte deleted the fix-duplicate-module-detection branch November 8, 2018 11:26
@github-actions
Copy link

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.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants