-
Notifications
You must be signed in to change notification settings - Fork 626
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
metro-file-map: Extract mocks handling into nullable MockMap (#1402)
Summary: Extract almost all mock handling logic out of `FileMap` and into `MockMap`. Mocks are obviously a Jest concept inherited from `jest-haste-map`, but we're keeping them around in `metro-file-map` for planned re-use of `metro-file-map` as a custom `hasteMapModulePath` in Jest, at least at Meta. This is a step towards making `MockMap` into a *plugin* or subscriber to `FileMap`, so that we don't need to keep it in `metro-file-map`'s codebase and can inject it where needed. Changelog: Internal (No Metro-user-facing change, `metro-file-map`'s API is [explicitly experimental](https://github.com/facebook/metro/tree/main/packages/metro-file-map#experimental-metro-file-map)) Test Plan: - New unit tests - `mocksPattern` is always `null` in Metro, so the new code isn't reached right now, except by tests. - We'll exercise this code next half when we use it in a Jest context. Differential Revision: D67056483 Pulled By: robhogan
- Loading branch information
1 parent
d1343fc
commit 664c5d6
Showing
4 changed files
with
127 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters