jest-expo 54.0.3 → 54.0.4
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 +2 -2
- package/src/preset/setup.js +10 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jest-expo",
|
|
3
|
-
"version": "54.0.
|
|
3
|
+
"version": "54.0.4",
|
|
4
4
|
"description": "A Jest preset to painlessly test your Expo / React Native apps.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"expo": "*",
|
|
59
59
|
"react-native": "*"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "d44e41c9c0714a838b1652556d27bcb506fabbdf"
|
|
62
62
|
}
|
package/src/preset/setup.js
CHANGED
|
@@ -190,18 +190,6 @@ jest.doMock('react-native/Libraries/LogBox/LogBox', () => ({
|
|
|
190
190
|
},
|
|
191
191
|
}));
|
|
192
192
|
|
|
193
|
-
// Mock the `createSnapshotFriendlyRef` to return an ref that can be serialized in snapshots.
|
|
194
|
-
jest.doMock('expo-modules-core/src/Refs', () => ({
|
|
195
|
-
createSnapshotFriendlyRef: () => {
|
|
196
|
-
// We cannot use `createRef` since it is not extensible.
|
|
197
|
-
const ref = { current: null };
|
|
198
|
-
Object.defineProperty(ref, 'toJSON', {
|
|
199
|
-
value: () => '[React.ref]',
|
|
200
|
-
});
|
|
201
|
-
return ref;
|
|
202
|
-
},
|
|
203
|
-
}));
|
|
204
|
-
|
|
205
193
|
function attemptLookup(moduleName) {
|
|
206
194
|
// hack to get the package name from the module name
|
|
207
195
|
const filePath = stackTrace.getSync().find((line) => line.fileName.includes(moduleName));
|
|
@@ -269,6 +257,16 @@ jest.doMock('expo-modules-core', () => {
|
|
|
269
257
|
NativeModule,
|
|
270
258
|
SharedObject,
|
|
271
259
|
|
|
260
|
+
// Mock the `createSnapshotFriendlyRef` to return an ref that can be serialized in snapshots.
|
|
261
|
+
createSnapshotFriendlyRef: () => {
|
|
262
|
+
// We cannot use `createRef` since it is not extensible.
|
|
263
|
+
const ref = { current: null };
|
|
264
|
+
Object.defineProperty(ref, 'toJSON', {
|
|
265
|
+
value: () => '[React.ref]',
|
|
266
|
+
});
|
|
267
|
+
return ref;
|
|
268
|
+
},
|
|
269
|
+
|
|
272
270
|
requireOptionalNativeModule: requireMockModule,
|
|
273
271
|
requireNativeModule(moduleName) {
|
|
274
272
|
const module = requireMockModule(moduleName);
|