-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RNMobile] Refactor UIManager native module mock (#29390)
* Update UIManager native module mock The way this native module was being mocked didn't work because UIManager is not exposed in NativeModules object and doMock wasn't overriding it properly. * Remove react-native-aztec mock * Refactor react-native module mock We currently reference TextStateInput (a private module) within react-native-aztec/src/AztecView. Doing so requires that we mock it via its internal path to avoid "TypeError: Cannot read property 'Commands' of undefined." The private module referenced could possibly be replaced with a React ref instead. We could then remove this internal mock. * Refactor to avoid inconsistent import pattern Generally, named exports are used when importing React Native modules. This changes the one exception in our source were we imported a default import of `ReactNative`. Importing this default also caused issues when attempting to mock `react-native` for Jest. This change will make future mocking in Jest easier. * Remove deprecated Jest config The `providesModuleNodeModules` option was removed from Jest. Including it in the Jest configuration displayed a warning on each run. https://git.io/JtNRI > Unknown option "haste.providesModuleNodeModules" with value ["react-native", "react-native-svg"] was found. This is probably a typing mistake. Fixing it will remove this message. * Add documentation for mock of internal React Native module Explain why we are mocking this internal React Native module for future reference. Co-authored-by: Carlos Garcia <[email protected]>
- Loading branch information
Showing
4 changed files
with
17 additions
and
52 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 was deleted.
Oops, something went wrong.
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