jest-expo 54.0.0-canary-20250729-d8899ae → 54.0.0-canary-20250826-f475166
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 +4 -4
- package/src/preset/moduleMocks/expoModules.js +71 -21
- package/src/preset/setup.js +10 -12
- package/src/resolveBabelConfig.js +11 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jest-expo",
|
|
3
|
-
"version": "54.0.0-canary-
|
|
3
|
+
"version": "54.0.0-canary-20250826-f475166",
|
|
4
4
|
"description": "A Jest preset to painlessly test your Expo / React Native apps.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"preset": "jest-expo/universal"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@expo/config": "
|
|
41
|
-
"@expo/json-file": "
|
|
40
|
+
"@expo/config": "12.0.5-canary-20250826-f475166",
|
|
41
|
+
"@expo/json-file": "10.0.4-canary-20250826-f475166",
|
|
42
42
|
"@jest/create-cache-key-function": "^29.2.1",
|
|
43
43
|
"@jest/globals": "^29.2.1",
|
|
44
44
|
"babel-jest": "^29.2.1",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"stacktrace-js": "^2.0.2"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
|
-
"expo": "54.0.0-canary-
|
|
58
|
+
"expo": "54.0.0-canary-20250826-f475166",
|
|
59
59
|
"react-native": "*"
|
|
60
60
|
}
|
|
61
61
|
}
|
|
@@ -259,6 +259,13 @@ module.exports = {
|
|
|
259
259
|
{ name: 'evalJsForWebViewAsync', argumentsCount: 2, key: 'evalJsForWebViewAsync' },
|
|
260
260
|
],
|
|
261
261
|
ExpoFetchModule: [],
|
|
262
|
+
ExpoFontLoader: [
|
|
263
|
+
{ name: 'getLoadedFonts', argumentsCount: 0, key: 'getLoadedFonts' },
|
|
264
|
+
{ name: 'loadAsync', argumentsCount: 2, key: 'loadAsync' },
|
|
265
|
+
],
|
|
266
|
+
ExpoFontUtils: [
|
|
267
|
+
{ name: 'renderToImageAsync', argumentsCount: 2, key: 'renderToImageAsync' },
|
|
268
|
+
],
|
|
262
269
|
ExpoGo: [{ name: 'getModulesSchema', argumentsCount: 0, key: 'getModulesSchema' }],
|
|
263
270
|
ExpoHaptics: [
|
|
264
271
|
{ name: 'impactAsync', argumentsCount: 1, key: 'impactAsync' },
|
|
@@ -276,6 +283,7 @@ module.exports = {
|
|
|
276
283
|
{ name: 'clearDiskCache', argumentsCount: 0, key: 'clearDiskCache' },
|
|
277
284
|
{ name: 'clearMemoryCache', argumentsCount: 0, key: 'clearMemoryCache' },
|
|
278
285
|
{ name: 'generateBlurhashAsync', argumentsCount: 2, key: 'generateBlurhashAsync' },
|
|
286
|
+
{ name: 'generateThumbhashAsync', argumentsCount: 1, key: 'generateThumbhashAsync' },
|
|
279
287
|
{ name: 'getCachePathAsync', argumentsCount: 1, key: 'getCachePathAsync' },
|
|
280
288
|
{ name: 'loadAsync', argumentsCount: 2, key: 'loadAsync' },
|
|
281
289
|
{ name: 'prefetch', argumentsCount: 3, key: 'prefetch' },
|
|
@@ -534,14 +542,14 @@ module.exports = {
|
|
|
534
542
|
],
|
|
535
543
|
ExpoNotificationsEmitter: [
|
|
536
544
|
{
|
|
537
|
-
name: '
|
|
545
|
+
name: 'clearLastNotificationResponse',
|
|
538
546
|
argumentsCount: 0,
|
|
539
|
-
key: '
|
|
547
|
+
key: 'clearLastNotificationResponse',
|
|
540
548
|
},
|
|
541
549
|
{
|
|
542
|
-
name: '
|
|
550
|
+
name: 'getLastNotificationResponse',
|
|
543
551
|
argumentsCount: 0,
|
|
544
|
-
key: '
|
|
552
|
+
key: 'getLastNotificationResponse',
|
|
545
553
|
},
|
|
546
554
|
],
|
|
547
555
|
ExpoNotificationsHandlerModule: [
|
|
@@ -560,8 +568,19 @@ module.exports = {
|
|
|
560
568
|
key: 'unregisterForNotificationsAsync',
|
|
561
569
|
},
|
|
562
570
|
],
|
|
571
|
+
ExpoRouterNativeLinkPreview: [],
|
|
563
572
|
ExpoScreenCapture: [
|
|
564
573
|
{ name: 'allowScreenCapture', argumentsCount: 0, key: 'allowScreenCapture' },
|
|
574
|
+
{
|
|
575
|
+
name: 'disableAppSwitcherProtection',
|
|
576
|
+
argumentsCount: 0,
|
|
577
|
+
key: 'disableAppSwitcherProtection',
|
|
578
|
+
},
|
|
579
|
+
{
|
|
580
|
+
name: 'enableAppSwitcherProtection',
|
|
581
|
+
argumentsCount: 1,
|
|
582
|
+
key: 'enableAppSwitcherProtection',
|
|
583
|
+
},
|
|
565
584
|
{ name: 'preventScreenCapture', argumentsCount: 0, key: 'preventScreenCapture' },
|
|
566
585
|
],
|
|
567
586
|
ExpoScreenOrientation: [
|
|
@@ -670,8 +689,9 @@ module.exports = {
|
|
|
670
689
|
{ name: 'openBrowserAsync', argumentsCount: 2, key: 'openBrowserAsync' },
|
|
671
690
|
{ name: 'warmUpAsync', argumentsCount: 0, key: 'warmUpAsync' },
|
|
672
691
|
],
|
|
673
|
-
|
|
674
|
-
{ name: 'downloadFileAsync', argumentsCount:
|
|
692
|
+
FileSystem: [
|
|
693
|
+
{ name: 'downloadFileAsync', argumentsCount: 3, key: 'downloadFileAsync' },
|
|
694
|
+
{ name: 'info', argumentsCount: 1, key: 'info' },
|
|
675
695
|
],
|
|
676
696
|
NotificationsServerRegistrationModule: [
|
|
677
697
|
{ name: 'getInstallationIdAsync', argumentsCount: 0, key: 'getInstallationIdAsync' },
|
|
@@ -900,6 +920,17 @@ module.exports = {
|
|
|
900
920
|
addListener: { type: 'function' },
|
|
901
921
|
removeListeners: { type: 'function' },
|
|
902
922
|
},
|
|
923
|
+
ExpoFontLoader: {
|
|
924
|
+
addListener: { type: 'function' },
|
|
925
|
+
getLoadedFonts: { type: 'function' },
|
|
926
|
+
loadAsync: { type: 'function' },
|
|
927
|
+
removeListeners: { type: 'function' },
|
|
928
|
+
},
|
|
929
|
+
ExpoFontUtils: {
|
|
930
|
+
addListener: { type: 'function' },
|
|
931
|
+
removeListeners: { type: 'function' },
|
|
932
|
+
renderToImageAsync: { type: 'function' },
|
|
933
|
+
},
|
|
903
934
|
ExpoGo: {
|
|
904
935
|
addListener: { type: 'function' },
|
|
905
936
|
expoVersion: { type: 'string' },
|
|
@@ -929,6 +960,7 @@ module.exports = {
|
|
|
929
960
|
clearDiskCache: { type: 'function' },
|
|
930
961
|
clearMemoryCache: { type: 'function' },
|
|
931
962
|
generateBlurhashAsync: { type: 'function' },
|
|
963
|
+
generateThumbhashAsync: { type: 'function' },
|
|
932
964
|
getCachePathAsync: { type: 'function' },
|
|
933
965
|
loadAsync: { type: 'function' },
|
|
934
966
|
prefetch: { type: 'function' },
|
|
@@ -1154,8 +1186,8 @@ module.exports = {
|
|
|
1154
1186
|
},
|
|
1155
1187
|
ExpoNotificationsEmitter: {
|
|
1156
1188
|
addListener: { type: 'function' },
|
|
1157
|
-
|
|
1158
|
-
|
|
1189
|
+
clearLastNotificationResponse: { type: 'function' },
|
|
1190
|
+
getLastNotificationResponse: { type: 'function' },
|
|
1159
1191
|
removeListeners: { type: 'function' },
|
|
1160
1192
|
},
|
|
1161
1193
|
ExpoNotificationsHandlerModule: {
|
|
@@ -1177,9 +1209,15 @@ module.exports = {
|
|
|
1177
1209
|
removeListeners: { type: 'function' },
|
|
1178
1210
|
unregisterForNotificationsAsync: { type: 'function' },
|
|
1179
1211
|
},
|
|
1212
|
+
ExpoRouterNativeLinkPreview: {
|
|
1213
|
+
addListener: { type: 'function' },
|
|
1214
|
+
removeListeners: { type: 'function' },
|
|
1215
|
+
},
|
|
1180
1216
|
ExpoScreenCapture: {
|
|
1181
1217
|
addListener: { type: 'function' },
|
|
1182
1218
|
allowScreenCapture: { type: 'function' },
|
|
1219
|
+
disableAppSwitcherProtection: { type: 'function' },
|
|
1220
|
+
enableAppSwitcherProtection: { type: 'function' },
|
|
1183
1221
|
preventScreenCapture: { type: 'function' },
|
|
1184
1222
|
removeListeners: { type: 'function' },
|
|
1185
1223
|
},
|
|
@@ -1231,16 +1269,6 @@ module.exports = {
|
|
|
1231
1269
|
speak: { type: 'function' },
|
|
1232
1270
|
stop: { type: 'function' },
|
|
1233
1271
|
},
|
|
1234
|
-
ExpoSplashScreen: {
|
|
1235
|
-
addListener: { type: 'function' },
|
|
1236
|
-
hide: { type: 'function' },
|
|
1237
|
-
hideAsync: { type: 'function' },
|
|
1238
|
-
internalMaybeHideAsync: { type: 'function' },
|
|
1239
|
-
internalPreventAutoHideAsync: { type: 'function' },
|
|
1240
|
-
preventAutoHideAsync: { type: 'function' },
|
|
1241
|
-
removeListeners: { type: 'function' },
|
|
1242
|
-
setOptions: { type: 'function' },
|
|
1243
|
-
},
|
|
1244
1272
|
ExpoSQLite: {
|
|
1245
1273
|
addListener: { type: 'function' },
|
|
1246
1274
|
backupDatabaseAsync: { type: 'function' },
|
|
@@ -1328,14 +1356,17 @@ module.exports = {
|
|
|
1328
1356
|
removeListeners: { type: 'function' },
|
|
1329
1357
|
warmUpAsync: { type: 'function' },
|
|
1330
1358
|
},
|
|
1331
|
-
|
|
1359
|
+
FileSystem: {
|
|
1332
1360
|
addListener: { type: 'function' },
|
|
1333
1361
|
appleSharedContainers: { type: 'object' },
|
|
1362
|
+
availableDiskSpace: { type: 'property' },
|
|
1334
1363
|
bundleDirectory: { type: 'string' },
|
|
1335
1364
|
cacheDirectory: { type: 'string' },
|
|
1336
1365
|
documentDirectory: { type: 'string' },
|
|
1337
1366
|
downloadFileAsync: { type: 'function' },
|
|
1367
|
+
info: { type: 'function' },
|
|
1338
1368
|
removeListeners: { type: 'function' },
|
|
1369
|
+
totalDiskSpace: { type: 'property' },
|
|
1339
1370
|
},
|
|
1340
1371
|
NotificationsServerRegistrationModule: {
|
|
1341
1372
|
addListener: { type: 'function' },
|
|
@@ -1401,6 +1432,7 @@ module.exports = {
|
|
|
1401
1432
|
'contentFit',
|
|
1402
1433
|
'contentPosition',
|
|
1403
1434
|
'enableLiveTextInteraction',
|
|
1435
|
+
'enforceEarlyResizing',
|
|
1404
1436
|
'placeholder',
|
|
1405
1437
|
'placeholderContentFit',
|
|
1406
1438
|
'priority',
|
|
@@ -1408,28 +1440,46 @@ module.exports = {
|
|
|
1408
1440
|
'source',
|
|
1409
1441
|
'tintColor',
|
|
1410
1442
|
'transition',
|
|
1443
|
+
'useAppleWebpCodec',
|
|
1411
1444
|
],
|
|
1412
1445
|
},
|
|
1413
1446
|
ExpoLinearGradient: { propNames: ['colors', 'endPoint', 'locations', 'startPoint'] },
|
|
1414
1447
|
ExpoLivePhoto: {
|
|
1415
1448
|
propNames: ['contentFit', 'isMuted', 'source', 'useDefaultGestureRecognizer'],
|
|
1416
1449
|
},
|
|
1450
|
+
ExponentGLView: { propNames: ['enableExperimentalWorkletSupport', 'msaaSamples'] },
|
|
1417
1451
|
ExpoRouterNativeLinkPreview: {
|
|
1418
|
-
propNames: [
|
|
1452
|
+
propNames: [
|
|
1453
|
+
'destructive',
|
|
1454
|
+
'disabled',
|
|
1455
|
+
'displayAsPalette',
|
|
1456
|
+
'displayInline',
|
|
1457
|
+
'icon',
|
|
1458
|
+
'isOn',
|
|
1459
|
+
'keepPresented',
|
|
1460
|
+
'nextScreenId',
|
|
1461
|
+
'preferredContentSize',
|
|
1462
|
+
'singleSelection',
|
|
1463
|
+
'tabPath',
|
|
1464
|
+
'title',
|
|
1465
|
+
],
|
|
1419
1466
|
},
|
|
1420
|
-
ExponentGLView: { propNames: ['enableExperimentalWorkletSupport', 'msaaSamples'] },
|
|
1421
1467
|
ExpoVideo: {
|
|
1422
1468
|
propNames: [
|
|
1469
|
+
'activeTint',
|
|
1423
1470
|
'allowsFullscreen',
|
|
1424
1471
|
'allowsPictureInPicture',
|
|
1425
1472
|
'allowsVideoFrameAnalysis',
|
|
1426
1473
|
'contentFit',
|
|
1427
1474
|
'contentPosition',
|
|
1475
|
+
'fullscreenOptions',
|
|
1428
1476
|
'nativeControls',
|
|
1429
1477
|
'player',
|
|
1478
|
+
'prioritizeVideoDevices',
|
|
1430
1479
|
'requiresLinearPlayback',
|
|
1431
1480
|
'showsTimecodes',
|
|
1432
1481
|
'startsPictureInPictureAutomatically',
|
|
1482
|
+
'tint',
|
|
1433
1483
|
],
|
|
1434
1484
|
},
|
|
1435
1485
|
ExpoVideoView: { propNames: ['resizeMode', 'source', 'status', 'useNativeControls'] },
|
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);
|
|
@@ -16,12 +16,18 @@ function resolveBabelConfig(projectRoot) {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
try {
|
|
19
|
-
return require.resolve('babel-preset
|
|
20
|
-
} catch
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
return require.resolve('expo/internal/babel-preset');
|
|
20
|
+
} catch {
|
|
21
|
+
try {
|
|
22
|
+
// TODO(@kitten): Temporary, since our E2E tests don't use monorepo
|
|
23
|
+
// packages consistently, including the `expo` package
|
|
24
|
+
return require.resolve('babel-preset-expo');
|
|
25
|
+
} catch (error) {
|
|
26
|
+
if (error.code === 'MODULE_NOT_FOUND') {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
throw error;
|
|
23
30
|
}
|
|
24
|
-
throw error;
|
|
25
31
|
}
|
|
26
32
|
}
|
|
27
33
|
|