-
-
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
Support custom platforms on jest-haste-map #3162
Conversation
Note: I sought to maintain all pre-existing behaviors with this change. Calling it with an arbitrary platforms array or no array at all should still return the same result for previously-supported platforms. |
Thanks @andrewimm. As a follow-up, I feel like it may make sense to turn the platforms object into a Set in the constructor so that lookups will be faster. Would you be interested in sending a PR for this? |
Sure, happy to follow up with a move to |
* [jest-jasmine2] Split `jasmine-light` over multiple files. * Don't wrap things that don't need to be wrapped. * Don't wrap things that don't need to be wrapped (again). * Lint. * [jest-jasmine2] Trim `jasmine` singleton. * Adding NHL to companies that use Jest (#3163) * Support custom platforms on jest-haste-map (#3162) * Support custom platforms on jest-haste-map * Run prettier * Rebase.
* Support custom platforms on jest-haste-map * Run prettier
* [jest-jasmine2] Split `jasmine-light` over multiple files. * Don't wrap things that don't need to be wrapped. * Don't wrap things that don't need to be wrapped (again). * Lint. * [jest-jasmine2] Trim `jasmine` singleton. * Adding NHL to companies that use Jest (jestjs#3163) * Support custom platforms on jest-haste-map (jestjs#3162) * Support custom platforms on jest-haste-map * Run prettier * Rebase.
* Support custom platforms on jest-haste-map * Run prettier
* [jest-jasmine2] Split `jasmine-light` over multiple files. * Don't wrap things that don't need to be wrapped. * Don't wrap things that don't need to be wrapped (again). * Lint. * [jest-jasmine2] Trim `jasmine` singleton. * Adding NHL to companies that use Jest (jestjs#3163) * Support custom platforms on jest-haste-map (jestjs#3162) * Support custom platforms on jest-haste-map * Run prettier * Rebase.
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
The options object allows specification of custom platforms, but jest-haste-map doesn't use this when checking for duplicates, which leads to a lot of unnecessary warning messages on custom platforms.
Test plan
Ran these changes on a project with the following package.json configuration:
And two files:
MyModule.js
andMyModule.vr.js
, both of which contain@providesModule MyModule
Without these changes, jest-haste-map produces a warning. With these changes, no warnings occur.