Commit 947f5cd
Fix
Summary:
Transition to `react-native/jest-preset` broke the `Image` mock, as it started to render unmocked `RCTImageView` instead of mocked `Image`. This is result of differences between node resolution that takes into account platform-specific imports (`Image.ios.js`) vs Jest mocking `Image.js`. This works fine in the files are in the same package, but broke when doing deep imports from separate package.
## Changelog:
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[INTERNAL] [FIXED] Fix `Image` Jest mock after extraction to `react-native/jest-preset`
Pull Request resolved: #55710
Test Plan: Added automated tests to showcase the issue
Reviewed By: cortinico
Differential Revision: D94508659
Pulled By: huntie
fbshipit-source-id: a7576e86ad188c917dfc2d2371b609e5b6a02a28Image Jest mock after extraction to separate package (#55710)1 parent 34779df commit 947f5cd
1 file changed
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
18 | 23 | | |
19 | 24 | | |
20 | 25 | | |
| |||
0 commit comments