jest-expo 58.0.12 → 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 +3 -3
- package/src/preset/setup.js +12 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jest-expo",
|
|
3
|
-
"version": "58.0.
|
|
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": {
|
|
@@ -46,13 +46,13 @@
|
|
|
46
46
|
"test-renderer": "1.3.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@react-native/jest-preset": "0.88.
|
|
49
|
+
"@react-native/jest-preset": "0.88.1",
|
|
50
50
|
"@types/node": "^22.14.0",
|
|
51
51
|
"@types/react": "~19.3.0",
|
|
52
52
|
"react-server-dom-webpack": "~19.0.8"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
|
-
"@react-native/jest-preset": "^0.88.
|
|
55
|
+
"@react-native/jest-preset": "^0.88.1",
|
|
56
56
|
"expo": "*",
|
|
57
57
|
"jest": "^29.0.0 || ^30.0.0",
|
|
58
58
|
"react-native": "*",
|
package/src/preset/setup.js
CHANGED
|
@@ -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,
|