jest-expo 58.0.13 → 58.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jest-expo",
3
- "version": "58.0.13",
3
+ "version": "58.0.14",
4
4
  "description": "A Jest preset to painlessly test your Expo / React Native apps.",
5
5
  "homepage": "https://github.com/expo/expo/tree/main/packages/jest-expo",
6
6
  "bugs": {
@@ -186,6 +186,18 @@ jest.mock('react-native/asset-registry', () => ({
186
186
  })),
187
187
  }));
188
188
 
189
+ // `import { AssetRegistry } from 'react-native'` loads this private module directly, not
190
+ // `react-native/asset-registry`. It is not in the `exports` map, so it needs an absolute path.
191
+ const reactNativeAssetRegistryPath = path.join(
192
+ path.dirname(require.resolve('react-native/package.json')),
193
+ 'src/private/assets/AssetRegistry.js'
194
+ );
195
+ if (fs.existsSync(reactNativeAssetRegistryPath)) {
196
+ jest.doMock(reactNativeAssetRegistryPath, () => ({
197
+ AssetRegistry: jest.requireMock('react-native/asset-registry'),
198
+ }));
199
+ }
200
+
189
201
  jest.doMock('react-native/Libraries/BatchedBridge/NativeModules', () => ({
190
202
  __esModule: true,
191
203
  default: mockNativeModules,