jest-expo 44.0.0-beta.0 → 45.0.0-beta.1
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/README.md +7 -8
- package/package.json +5 -6
- package/src/preset/expoModules.js +201 -99
- package/src/preset/setup.js +10 -8
package/README.md
CHANGED
|
@@ -2,18 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
A [Jest](https://facebook.github.io/jest/) preset to painlessly test your Expo / React Native apps.
|
|
4
4
|
|
|
5
|
-
If you have problems with the code in this repository, please file issues & bug reports
|
|
6
|
-
at https://github.com/expo/expo. Thanks!
|
|
7
|
-
|
|
8
5
|
### Installation
|
|
9
6
|
|
|
10
|
-
-
|
|
7
|
+
- To install the compatible version of `jest-expo` and `jest` for your project, run: `expo install jest-expo jest`.
|
|
11
8
|
- Add the following config to `package.json`:
|
|
12
9
|
|
|
13
|
-
```
|
|
10
|
+
```json
|
|
14
11
|
"scripts": {
|
|
15
|
-
|
|
16
|
-
"test
|
|
12
|
+
...
|
|
13
|
+
"test": "jest"
|
|
17
14
|
},
|
|
18
15
|
"jest": {
|
|
19
16
|
"preset": "jest-expo"
|
|
@@ -30,6 +27,8 @@ at https://github.com/expo/expo. Thanks!
|
|
|
30
27
|
|
|
31
28
|
- Run `npm test` and it should pass
|
|
32
29
|
|
|
30
|
+
> You can use a different version of `jest` than the one that is installed with `expo install`, but keep in mind that the SDK and `jest-expo` are built against that version.
|
|
31
|
+
|
|
33
32
|
## Platforms
|
|
34
33
|
|
|
35
34
|
You can use `jest-expo` to test any Expo supported platform. For legacy purposes `jest-expo` runs your tests in the standard React Native environment (iOS).
|
|
@@ -116,4 +115,4 @@ Alternative to `jest-expo/node`. This runs in a Node environment for testing **S
|
|
|
116
115
|
|
|
117
116
|
### Learning Jest
|
|
118
117
|
|
|
119
|
-
[Read the
|
|
118
|
+
[Read the Jest documentation](https://facebook.github.io/jest/)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jest-expo",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "45.0.0-beta.1",
|
|
4
4
|
"description": "A Jest preset to painlessly test your Expo / React Native apps.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "src",
|
|
@@ -31,20 +31,19 @@
|
|
|
31
31
|
"preset": "jest-expo/universal"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@expo/config": "^6.0.
|
|
34
|
+
"@expo/config": "^6.0.14",
|
|
35
35
|
"@jest/create-cache-key-function": "^26.6.2",
|
|
36
36
|
"babel-jest": "^26.6.3",
|
|
37
37
|
"find-up": "^5.0.0",
|
|
38
|
-
"jest": "^26.6.3",
|
|
39
38
|
"jest-watch-select-projects": "^2.0.0",
|
|
40
39
|
"jest-watch-typeahead": "0.6.4",
|
|
41
40
|
"json5": "^2.1.0",
|
|
42
41
|
"lodash": "^4.17.19",
|
|
43
|
-
"react-test-renderer": "~17.0.
|
|
42
|
+
"react-test-renderer": "~17.0.2"
|
|
44
43
|
},
|
|
45
44
|
"bugs": {
|
|
46
45
|
"url": "https://github.com/expo/expo/issues"
|
|
47
46
|
},
|
|
48
|
-
"homepage": "https://github.com/expo/expo/tree/
|
|
49
|
-
"gitHead": "
|
|
47
|
+
"homepage": "https://github.com/expo/expo/tree/main/packages/jest-expo",
|
|
48
|
+
"gitHead": "22dce752354bb429c84851bc4389abe47a766b1f"
|
|
50
49
|
}
|
|
@@ -78,11 +78,6 @@ module.exports = {
|
|
|
78
78
|
getNativeModuleNamesAsync: { type: 'function', functionType: 'promise' },
|
|
79
79
|
introspectNativeModuleAsync: { type: 'function', functionType: 'promise' },
|
|
80
80
|
},
|
|
81
|
-
ExpoRandom: {
|
|
82
|
-
getConstants: { type: 'function' },
|
|
83
|
-
getRandomBase64String: { type: 'function', functionType: 'sync' },
|
|
84
|
-
getRandomBase64StringAsync: { type: 'function', functionType: 'promise' },
|
|
85
|
-
},
|
|
86
81
|
ExponentAV: { Qualities: { type: 'object' }, getConstants: { type: 'function' } },
|
|
87
82
|
ExponentNotifications: {
|
|
88
83
|
cancelAllScheduledNotificationsAsync: { type: 'function', functionType: 'promise' },
|
|
@@ -175,7 +170,6 @@ module.exports = {
|
|
|
175
170
|
{ key: 6, argumentsCount: 1, name: 'setUserIdAsync' },
|
|
176
171
|
{ key: 7, argumentsCount: 0, name: 'clearUserPropertiesAsync' },
|
|
177
172
|
],
|
|
178
|
-
ExpoAppAuth: [{ key: 0, argumentsCount: 1, name: 'executeAsync' }],
|
|
179
173
|
ExpoAppleAuthentication: [
|
|
180
174
|
{ key: 0, argumentsCount: 0, name: 'isAvailableAsync' },
|
|
181
175
|
{ key: 1, argumentsCount: 1, name: 'requestAsync' },
|
|
@@ -260,30 +254,37 @@ module.exports = {
|
|
|
260
254
|
{ key: 18, argumentsCount: 1, name: 'getSourceByIdAsync' },
|
|
261
255
|
],
|
|
262
256
|
ExpoCellular: [
|
|
263
|
-
{ key: 'allowsVoipAsync', argumentsCount: 0, name: 'allowsVoipAsync' },
|
|
264
257
|
{
|
|
265
|
-
name: 'getCellularGenerationAsync',
|
|
266
258
|
argumentsCount: 0,
|
|
267
259
|
key: 'getCellularGenerationAsync',
|
|
260
|
+
name: 'getCellularGenerationAsync',
|
|
268
261
|
},
|
|
262
|
+
{ key: 'getCarrierNameAsync', argumentsCount: 0, name: 'getCarrierNameAsync' },
|
|
263
|
+
{ name: 'allowsVoipAsync', key: 'allowsVoipAsync', argumentsCount: 0 },
|
|
269
264
|
{
|
|
270
|
-
name: 'getMobileNetworkCodeAsync',
|
|
271
265
|
argumentsCount: 0,
|
|
272
|
-
key: '
|
|
266
|
+
key: 'getMobileCountryCodeAsync',
|
|
267
|
+
name: 'getMobileCountryCodeAsync',
|
|
273
268
|
},
|
|
274
|
-
{ name: 'getCarrierNameAsync', key: 'getCarrierNameAsync', argumentsCount: 0 },
|
|
275
269
|
{
|
|
276
|
-
|
|
270
|
+
name: 'getMobileNetworkCodeAsync',
|
|
277
271
|
argumentsCount: 0,
|
|
278
|
-
|
|
272
|
+
key: 'getMobileNetworkCodeAsync',
|
|
279
273
|
},
|
|
280
|
-
{
|
|
274
|
+
{ argumentsCount: 0, name: 'getIsoCountryCodeAsync', key: 'getIsoCountryCodeAsync' },
|
|
281
275
|
],
|
|
282
276
|
ExpoClipboard: [
|
|
283
|
-
{
|
|
284
|
-
{ argumentsCount: 0,
|
|
285
|
-
{
|
|
286
|
-
{
|
|
277
|
+
{ argumentsCount: 1, name: 'setStringAsync', key: 'setStringAsync' },
|
|
278
|
+
{ argumentsCount: 0, name: 'getStringAsync', key: 'getStringAsync' },
|
|
279
|
+
{ name: 'getImageAsync', key: 'getImageAsync', argumentsCount: 1 },
|
|
280
|
+
{ key: 'hasStringAsync', argumentsCount: 0, name: 'hasStringAsync' },
|
|
281
|
+
{ key: 'startObserving', argumentsCount: 0, name: 'startObserving' },
|
|
282
|
+
{ name: 'stopObserving', key: 'stopObserving', argumentsCount: 0 },
|
|
283
|
+
{ key: 'hasUrlAsync', argumentsCount: 0, name: 'hasUrlAsync' },
|
|
284
|
+
{ key: 'hasImageAsync', name: 'hasImageAsync', argumentsCount: 0 },
|
|
285
|
+
{ key: 'getUrlAsync', argumentsCount: 0, name: 'getUrlAsync' },
|
|
286
|
+
{ argumentsCount: 1, key: 'setUrlAsync', name: 'setUrlAsync' },
|
|
287
|
+
{ argumentsCount: 1, name: 'setImageAsync', key: 'setImageAsync' },
|
|
287
288
|
],
|
|
288
289
|
ExpoContacts: [
|
|
289
290
|
{ key: 0, argumentsCount: 0, name: 'getDefaultContainerIdentifierAsync' },
|
|
@@ -305,7 +306,10 @@ module.exports = {
|
|
|
305
306
|
{ key: 16, argumentsCount: 1, name: 'writeContactToFileAsync' },
|
|
306
307
|
{ key: 17, argumentsCount: 0, name: 'dismissFormAsync' },
|
|
307
308
|
],
|
|
308
|
-
ExpoCrypto: [
|
|
309
|
+
ExpoCrypto: [
|
|
310
|
+
{ argumentsCount: 3, name: 'digestStringAsync', key: 'digestStringAsync' },
|
|
311
|
+
{ name: 'digestString', key: 'digestString', argumentsCount: 3 },
|
|
312
|
+
],
|
|
309
313
|
ExpoDevice: [
|
|
310
314
|
{ key: 0, argumentsCount: 0, name: 'getDeviceTypeAsync' },
|
|
311
315
|
{ key: 1, argumentsCount: 0, name: 'isRootedExperimentalAsync' },
|
|
@@ -337,14 +341,17 @@ module.exports = {
|
|
|
337
341
|
{ key: 8, argumentsCount: 0, name: 'isConnectedAsync' },
|
|
338
342
|
],
|
|
339
343
|
ExpoHaptics: [
|
|
340
|
-
{
|
|
341
|
-
{ key: '
|
|
342
|
-
{
|
|
344
|
+
{ name: 'notificationAsync', argumentsCount: 1, key: 'notificationAsync' },
|
|
345
|
+
{ argumentsCount: 1, key: 'impactAsync', name: 'impactAsync' },
|
|
346
|
+
{ argumentsCount: 0, name: 'selectionAsync', key: 'selectionAsync' },
|
|
347
|
+
],
|
|
348
|
+
ExpoImageManipulator: [
|
|
349
|
+
{ key: 'manipulateAsync', name: 'manipulateAsync', argumentsCount: 3 },
|
|
343
350
|
],
|
|
344
|
-
ExpoImageManipulator: [{ key: 0, argumentsCount: 3, name: 'manipulateAsync' }],
|
|
345
351
|
ExpoKeepAwake: [
|
|
346
|
-
{ key:
|
|
347
|
-
{
|
|
352
|
+
{ key: 'activate', argumentsCount: 1, name: 'activate' },
|
|
353
|
+
{ name: 'deactivate', argumentsCount: 1, key: 'deactivate' },
|
|
354
|
+
{ key: 'isActivated', argumentsCount: 0, name: 'isActivated' },
|
|
348
355
|
],
|
|
349
356
|
ExpoLinearGradient: [],
|
|
350
357
|
ExpoLocalAuthentication: [
|
|
@@ -355,7 +362,7 @@ module.exports = {
|
|
|
355
362
|
{ key: 4, argumentsCount: 1, name: 'authenticateAsync' },
|
|
356
363
|
],
|
|
357
364
|
ExpoLocalization: [
|
|
358
|
-
{
|
|
365
|
+
{ name: 'getLocalizationAsync', key: 'getLocalizationAsync', argumentsCount: 0 },
|
|
359
366
|
],
|
|
360
367
|
ExpoLocation: [
|
|
361
368
|
{ key: 0, argumentsCount: 2, name: 'watchPositionImplAsync' },
|
|
@@ -422,6 +429,14 @@ module.exports = {
|
|
|
422
429
|
],
|
|
423
430
|
ExpoPublisherBannerView: [],
|
|
424
431
|
ExpoPushTokenManager: [{ key: 0, argumentsCount: 0, name: 'getDevicePushTokenAsync' }],
|
|
432
|
+
ExpoRandom: [
|
|
433
|
+
{
|
|
434
|
+
argumentsCount: 1,
|
|
435
|
+
name: 'getRandomBase64StringAsync',
|
|
436
|
+
key: 'getRandomBase64StringAsync',
|
|
437
|
+
},
|
|
438
|
+
{ name: 'getRandomBase64String', key: 'getRandomBase64String', argumentsCount: 1 },
|
|
439
|
+
],
|
|
425
440
|
ExpoSMS: [
|
|
426
441
|
{ key: 0, argumentsCount: 0, name: 'isAvailableAsync' },
|
|
427
442
|
{ key: 1, argumentsCount: 3, name: 'sendSMSAsync' },
|
|
@@ -453,8 +468,8 @@ module.exports = {
|
|
|
453
468
|
{ key: 1, argumentsCount: 0, name: 'requestReview' },
|
|
454
469
|
],
|
|
455
470
|
ExpoSystemUI: [
|
|
456
|
-
{ name: 'setBackgroundColorAsync', argumentsCount: 1, key: 'setBackgroundColorAsync' },
|
|
457
471
|
{ argumentsCount: 0, name: 'getBackgroundColorAsync', key: 'getBackgroundColorAsync' },
|
|
472
|
+
{ name: 'setBackgroundColorAsync', key: 'setBackgroundColorAsync', argumentsCount: 1 },
|
|
458
473
|
],
|
|
459
474
|
ExpoTaskManager: [
|
|
460
475
|
{ key: 0, argumentsCount: 0, name: 'isAvailableAsync' },
|
|
@@ -466,8 +481,8 @@ module.exports = {
|
|
|
466
481
|
{ key: 6, argumentsCount: 0, name: 'getRegisteredTasksAsync' },
|
|
467
482
|
],
|
|
468
483
|
ExpoTrackingTransparency: [
|
|
469
|
-
{ name: 'requestPermissionsAsync', key: 'requestPermissionsAsync'
|
|
470
|
-
{
|
|
484
|
+
{ argumentsCount: 0, name: 'requestPermissionsAsync', key: 'requestPermissionsAsync' },
|
|
485
|
+
{ name: 'getPermissionsAsync', key: 'getPermissionsAsync', argumentsCount: 0 },
|
|
471
486
|
],
|
|
472
487
|
ExpoUpdates: [
|
|
473
488
|
{ key: 0, argumentsCount: 0, name: 'checkForUpdateAsync' },
|
|
@@ -477,14 +492,18 @@ module.exports = {
|
|
|
477
492
|
ExpoVideoManager: [{ key: 0, argumentsCount: 2, name: 'setFullscreen' }],
|
|
478
493
|
ExpoVideoThumbnails: [{ key: 0, argumentsCount: 2, name: 'getThumbnail' }],
|
|
479
494
|
ExpoWebBrowser: [
|
|
480
|
-
{
|
|
481
|
-
{ key:
|
|
482
|
-
{
|
|
483
|
-
{
|
|
484
|
-
{ key:
|
|
485
|
-
{
|
|
486
|
-
{
|
|
487
|
-
|
|
495
|
+
{ argumentsCount: 2, name: 'openBrowserAsync', key: 'openBrowserAsync' },
|
|
496
|
+
{ key: 'openAuthSessionAsync', name: 'openAuthSessionAsync', argumentsCount: 2 },
|
|
497
|
+
{ name: 'warmUpAsync', argumentsCount: 0, key: 'warmUpAsync' },
|
|
498
|
+
{ argumentsCount: 0, name: 'dismissAuthSession', key: 'dismissAuthSession' },
|
|
499
|
+
{ key: 'mayInitWithUrlAsync', argumentsCount: 0, name: 'mayInitWithUrlAsync' },
|
|
500
|
+
{ name: 'coolDownAsync', key: 'coolDownAsync', argumentsCount: 0 },
|
|
501
|
+
{
|
|
502
|
+
name: 'getCustomTabsSupportingBrowsers',
|
|
503
|
+
key: 'getCustomTabsSupportingBrowsers',
|
|
504
|
+
argumentsCount: 0,
|
|
505
|
+
},
|
|
506
|
+
{ key: 'dismissBrowser', name: 'dismissBrowser', argumentsCount: 0 },
|
|
488
507
|
],
|
|
489
508
|
ExponentAV: [
|
|
490
509
|
{ key: 0, argumentsCount: 1, name: 'getStatusForVideo' },
|
|
@@ -492,21 +511,24 @@ module.exports = {
|
|
|
492
511
|
{ key: 2, argumentsCount: 0, name: 'unloadAudioRecorder' },
|
|
493
512
|
{ key: 3, argumentsCount: 0, name: 'stopAudioRecording' },
|
|
494
513
|
{ key: 4, argumentsCount: 0, name: 'requestPermissionsAsync' },
|
|
495
|
-
{ key: 5, argumentsCount:
|
|
496
|
-
{ key: 6, argumentsCount:
|
|
497
|
-
{ key: 7, argumentsCount: 1, name: '
|
|
498
|
-
{ key: 8, argumentsCount:
|
|
499
|
-
{ key: 9, argumentsCount:
|
|
500
|
-
{ key: 10, argumentsCount:
|
|
501
|
-
{ key: 11, argumentsCount:
|
|
502
|
-
{ key: 12, argumentsCount:
|
|
503
|
-
{ key: 13, argumentsCount:
|
|
504
|
-
{ key: 14, argumentsCount:
|
|
505
|
-
{ key: 15, argumentsCount:
|
|
506
|
-
{ key: 16, argumentsCount:
|
|
507
|
-
{ key: 17, argumentsCount:
|
|
508
|
-
{ key: 18, argumentsCount:
|
|
509
|
-
{ key: 19, argumentsCount: 0, name: '
|
|
514
|
+
{ key: 5, argumentsCount: 1, name: 'setInput' },
|
|
515
|
+
{ key: 6, argumentsCount: 3, name: 'loadForVideo' },
|
|
516
|
+
{ key: 7, argumentsCount: 1, name: 'setAudioIsEnabled' },
|
|
517
|
+
{ key: 8, argumentsCount: 1, name: 'prepareAudioRecorder' },
|
|
518
|
+
{ key: 9, argumentsCount: 2, name: 'replayVideo' },
|
|
519
|
+
{ key: 10, argumentsCount: 0, name: 'getPermissionsAsync' },
|
|
520
|
+
{ key: 11, argumentsCount: 1, name: 'unloadForSound' },
|
|
521
|
+
{ key: 12, argumentsCount: 2, name: 'setStatusForSound' },
|
|
522
|
+
{ key: 13, argumentsCount: 1, name: 'unloadForVideo' },
|
|
523
|
+
{ key: 14, argumentsCount: 2, name: 'replaySound' },
|
|
524
|
+
{ key: 15, argumentsCount: 0, name: 'getAvailableInputs' },
|
|
525
|
+
{ key: 16, argumentsCount: 0, name: 'getAudioRecordingStatus' },
|
|
526
|
+
{ key: 17, argumentsCount: 2, name: 'setStatusForVideo' },
|
|
527
|
+
{ key: 18, argumentsCount: 2, name: 'loadForSound' },
|
|
528
|
+
{ key: 19, argumentsCount: 0, name: 'pauseAudioRecording' },
|
|
529
|
+
{ key: 20, argumentsCount: 1, name: 'getStatusForSound' },
|
|
530
|
+
{ key: 21, argumentsCount: 0, name: 'getCurrentInput' },
|
|
531
|
+
{ key: 22, argumentsCount: 0, name: 'startAudioRecording' },
|
|
510
532
|
],
|
|
511
533
|
ExponentAccelerometer: [
|
|
512
534
|
{ key: 0, argumentsCount: 0, name: 'isAvailableAsync' },
|
|
@@ -584,12 +606,28 @@ module.exports = {
|
|
|
584
606
|
{ key: 1, argumentsCount: 1, name: 'setUpdateInterval' },
|
|
585
607
|
],
|
|
586
608
|
ExponentImagePicker: [
|
|
587
|
-
{
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
{
|
|
609
|
+
{
|
|
610
|
+
name: 'getMediaLibraryPermissionsAsync',
|
|
611
|
+
argumentsCount: 1,
|
|
612
|
+
key: 'getMediaLibraryPermissionsAsync',
|
|
613
|
+
},
|
|
614
|
+
{ argumentsCount: 1, name: 'launchCameraAsync', key: 'launchCameraAsync' },
|
|
615
|
+
{
|
|
616
|
+
key: 'requestCameraPermissionsAsync',
|
|
617
|
+
argumentsCount: 0,
|
|
618
|
+
name: 'requestCameraPermissionsAsync',
|
|
619
|
+
},
|
|
620
|
+
{
|
|
621
|
+
key: 'requestMediaLibraryPermissionsAsync',
|
|
622
|
+
name: 'requestMediaLibraryPermissionsAsync',
|
|
623
|
+
argumentsCount: 1,
|
|
624
|
+
},
|
|
625
|
+
{ key: 'launchImageLibraryAsync', name: 'launchImageLibraryAsync', argumentsCount: 1 },
|
|
626
|
+
{
|
|
627
|
+
key: 'getCameraPermissionsAsync',
|
|
628
|
+
argumentsCount: 0,
|
|
629
|
+
name: 'getCameraPermissionsAsync',
|
|
630
|
+
},
|
|
593
631
|
],
|
|
594
632
|
ExponentMagnetometer: [
|
|
595
633
|
{ key: 0, argumentsCount: 0, name: 'isAvailableAsync' },
|
|
@@ -681,13 +719,6 @@ module.exports = {
|
|
|
681
719
|
setMeditationService: { type: 'function' },
|
|
682
720
|
setUrlPrefix: { type: 'function' },
|
|
683
721
|
},
|
|
684
|
-
ExpoAppAuth: {
|
|
685
|
-
OAuthRedirect: { type: 'array' },
|
|
686
|
-
URLSchemes: { type: 'array' },
|
|
687
|
-
addListener: { type: 'function' },
|
|
688
|
-
executeAsync: { type: 'function' },
|
|
689
|
-
removeListeners: { type: 'function' },
|
|
690
|
-
},
|
|
691
722
|
ExpoApplication: {
|
|
692
723
|
addListener: { type: 'function' },
|
|
693
724
|
applicationId: { type: 'string' },
|
|
@@ -735,12 +766,25 @@ module.exports = {
|
|
|
735
766
|
},
|
|
736
767
|
ExpoClipboard: {
|
|
737
768
|
addListener: { type: 'function' },
|
|
769
|
+
getImageAsync: { type: 'function' },
|
|
738
770
|
getStringAsync: { type: 'function' },
|
|
771
|
+
getUrlAsync: { type: 'function' },
|
|
772
|
+
hasImageAsync: { type: 'function' },
|
|
773
|
+
hasStringAsync: { type: 'function' },
|
|
774
|
+
hasUrlAsync: { type: 'function' },
|
|
739
775
|
removeListeners: { type: 'function' },
|
|
740
|
-
|
|
776
|
+
setImageAsync: { type: 'function' },
|
|
777
|
+
setStringAsync: { type: 'function' },
|
|
778
|
+
setUrlAsync: { type: 'function' },
|
|
741
779
|
startObserving: { type: 'function' },
|
|
742
780
|
stopObserving: { type: 'function' },
|
|
743
781
|
},
|
|
782
|
+
ExpoCrypto: {
|
|
783
|
+
addListener: { type: 'function' },
|
|
784
|
+
digestString: { type: 'function' },
|
|
785
|
+
digestStringAsync: { type: 'function' },
|
|
786
|
+
removeListeners: { type: 'function' },
|
|
787
|
+
},
|
|
744
788
|
ExpoDevice: {
|
|
745
789
|
addListener: { type: 'function' },
|
|
746
790
|
brand: { type: 'string' },
|
|
@@ -752,6 +796,7 @@ module.exports = {
|
|
|
752
796
|
isRootedExperimentalAsync: { type: 'function' },
|
|
753
797
|
manufacturer: { type: 'string' },
|
|
754
798
|
modelId: { type: 'string' },
|
|
799
|
+
modelName: { type: 'string' },
|
|
755
800
|
osBuildId: { type: 'string' },
|
|
756
801
|
osInternalBuildId: { type: 'string' },
|
|
757
802
|
osName: { type: 'string' },
|
|
@@ -802,6 +847,18 @@ module.exports = {
|
|
|
802
847
|
removeListeners: { type: 'function' },
|
|
803
848
|
selectionAsync: { type: 'function' },
|
|
804
849
|
},
|
|
850
|
+
ExpoImageManipulator: {
|
|
851
|
+
addListener: { type: 'function' },
|
|
852
|
+
manipulateAsync: { type: 'function' },
|
|
853
|
+
removeListeners: { type: 'function' },
|
|
854
|
+
},
|
|
855
|
+
ExpoKeepAwake: {
|
|
856
|
+
activate: { type: 'function' },
|
|
857
|
+
addListener: { type: 'function' },
|
|
858
|
+
deactivate: { type: 'function' },
|
|
859
|
+
isActivated: { type: 'function' },
|
|
860
|
+
removeListeners: { type: 'function' },
|
|
861
|
+
},
|
|
805
862
|
ExpoLinearGradient: {
|
|
806
863
|
addListener: { type: 'function' },
|
|
807
864
|
removeListeners: { type: 'function' },
|
|
@@ -821,6 +878,12 @@ module.exports = {
|
|
|
821
878
|
removeListeners: { type: 'function' },
|
|
822
879
|
timezone: { type: 'string' },
|
|
823
880
|
},
|
|
881
|
+
ExpoRandom: {
|
|
882
|
+
addListener: { type: 'function' },
|
|
883
|
+
getRandomBase64String: { type: 'function' },
|
|
884
|
+
getRandomBase64StringAsync: { type: 'function' },
|
|
885
|
+
removeListeners: { type: 'function' },
|
|
886
|
+
},
|
|
824
887
|
ExpoSecureStore: {
|
|
825
888
|
AFTER_FIRST_UNLOCK: { type: 'number', mock: 0 },
|
|
826
889
|
AFTER_FIRST_UNLOCK_THIS_DEVICE_ONLY: { type: 'number', mock: 1 },
|
|
@@ -861,12 +924,15 @@ module.exports = {
|
|
|
861
924
|
},
|
|
862
925
|
ExpoUpdates: {
|
|
863
926
|
addListener: { type: 'function' },
|
|
927
|
+
channel: { type: 'string' },
|
|
864
928
|
checkForUpdateAsync: { type: 'function' },
|
|
865
929
|
fetchUpdateAsync: { type: 'function' },
|
|
866
930
|
isEnabled: { type: 'boolean', mock: false },
|
|
867
931
|
isMissingRuntimeVersion: { type: 'boolean', mock: false },
|
|
932
|
+
releaseChannel: { type: 'string' },
|
|
868
933
|
reload: { type: 'function' },
|
|
869
934
|
removeListeners: { type: 'function' },
|
|
935
|
+
runtimeVersion: { type: 'string' },
|
|
870
936
|
},
|
|
871
937
|
ExpoVideoManager: {
|
|
872
938
|
ScaleAspectFill: { type: 'string' },
|
|
@@ -877,10 +943,24 @@ module.exports = {
|
|
|
877
943
|
removeListeners: { type: 'function' },
|
|
878
944
|
setFullscreen: { type: 'function' },
|
|
879
945
|
},
|
|
946
|
+
ExpoWebBrowser: {
|
|
947
|
+
addListener: { type: 'function' },
|
|
948
|
+
coolDownAsync: { type: 'function' },
|
|
949
|
+
dismissAuthSession: { type: 'function' },
|
|
950
|
+
dismissBrowser: { type: 'function' },
|
|
951
|
+
getCustomTabsSupportingBrowsers: { type: 'function' },
|
|
952
|
+
mayInitWithUrlAsync: { type: 'function' },
|
|
953
|
+
openAuthSessionAsync: { type: 'function' },
|
|
954
|
+
openBrowserAsync: { type: 'function' },
|
|
955
|
+
removeListeners: { type: 'function' },
|
|
956
|
+
warmUpAsync: { type: 'function' },
|
|
957
|
+
},
|
|
880
958
|
ExponentAV: {
|
|
881
959
|
Qualities: { type: 'object' },
|
|
882
960
|
addListener: { type: 'function' },
|
|
883
961
|
getAudioRecordingStatus: { type: 'function' },
|
|
962
|
+
getAvailableInputs: { type: 'function' },
|
|
963
|
+
getCurrentInput: { type: 'function' },
|
|
884
964
|
getPermissionsAsync: { type: 'function' },
|
|
885
965
|
getStatusForSound: { type: 'function' },
|
|
886
966
|
getStatusForVideo: { type: 'function' },
|
|
@@ -894,6 +974,7 @@ module.exports = {
|
|
|
894
974
|
requestPermissionsAsync: { type: 'function' },
|
|
895
975
|
setAudioIsEnabled: { type: 'function' },
|
|
896
976
|
setAudioMode: { type: 'function' },
|
|
977
|
+
setInput: { type: 'function' },
|
|
897
978
|
setStatusForSound: { type: 'function' },
|
|
898
979
|
setStatusForVideo: { type: 'function' },
|
|
899
980
|
startAudioRecording: { type: 'function' },
|
|
@@ -983,6 +1064,16 @@ module.exports = {
|
|
|
983
1064
|
uploadTaskStartAsync: { type: 'function' },
|
|
984
1065
|
writeAsStringAsync: { type: 'function' },
|
|
985
1066
|
},
|
|
1067
|
+
ExponentImagePicker: {
|
|
1068
|
+
addListener: { type: 'function' },
|
|
1069
|
+
getCameraPermissionsAsync: { type: 'function' },
|
|
1070
|
+
getMediaLibraryPermissionsAsync: { type: 'function' },
|
|
1071
|
+
launchCameraAsync: { type: 'function' },
|
|
1072
|
+
launchImageLibraryAsync: { type: 'function' },
|
|
1073
|
+
removeListeners: { type: 'function' },
|
|
1074
|
+
requestCameraPermissionsAsync: { type: 'function' },
|
|
1075
|
+
requestMediaLibraryPermissionsAsync: { type: 'function' },
|
|
1076
|
+
},
|
|
986
1077
|
ExponentMediaLibrary: {
|
|
987
1078
|
CHANGE_LISTENER_NAME: { type: 'string' },
|
|
988
1079
|
MediaType: { type: 'object' },
|
|
@@ -1015,32 +1106,50 @@ module.exports = {
|
|
|
1015
1106
|
},
|
|
1016
1107
|
},
|
|
1017
1108
|
},
|
|
1018
|
-
|
|
1019
|
-
type: '
|
|
1020
|
-
mock:
|
|
1021
|
-
'
|
|
1022
|
-
'
|
|
1023
|
-
'
|
|
1024
|
-
'
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
'
|
|
1029
|
-
'
|
|
1030
|
-
'
|
|
1031
|
-
'
|
|
1032
|
-
'
|
|
1033
|
-
'
|
|
1034
|
-
'
|
|
1035
|
-
'
|
|
1036
|
-
|
|
1037
|
-
'
|
|
1038
|
-
'
|
|
1039
|
-
'
|
|
1040
|
-
'
|
|
1041
|
-
|
|
1042
|
-
'
|
|
1043
|
-
|
|
1109
|
+
viewManagersMetadata: {
|
|
1110
|
+
type: 'object',
|
|
1111
|
+
mock: {
|
|
1112
|
+
ExpoAppleAuthenticationButtonSignUpBlack: { propsNames: ['cornerRadius'] },
|
|
1113
|
+
ExpoVideoView: { propsNames: ['status', 'resizeMode', 'useNativeControls', 'source'] },
|
|
1114
|
+
ExpoAppleAuthenticationButtonSignInBlack: { propsNames: ['cornerRadius'] },
|
|
1115
|
+
ExpoBlurView: { propsNames: ['intensity', 'tint'] },
|
|
1116
|
+
ExpoAdsAdMobBannerView: {
|
|
1117
|
+
propsNames: ['additionalRequestParams', 'bannerSize', 'adUnitID'],
|
|
1118
|
+
},
|
|
1119
|
+
AdOptionsView: { propsNames: ['nativeAdViewTag', 'iconColor'] },
|
|
1120
|
+
ExpoAppleAuthenticationButtonSignUpWhite: { propsNames: ['cornerRadius'] },
|
|
1121
|
+
ExpoAppleAuthenticationButtonSignInWhite: { propsNames: ['cornerRadius'] },
|
|
1122
|
+
ExpoLinearGradient: { propsNames: ['colors', 'startPoint', 'endPoint', 'locations'] },
|
|
1123
|
+
ExpoAppleAuthenticationButtonContinueWhiteOutline: { propsNames: ['cornerRadius'] },
|
|
1124
|
+
ExpoBarCodeScannerView: { propsNames: ['type', 'barCodeTypes'] },
|
|
1125
|
+
ExpoAppleAuthenticationButtonSignInWhiteOutline: { propsNames: ['cornerRadius'] },
|
|
1126
|
+
ExponentGLView: { propsNames: ['msaaSamples'] },
|
|
1127
|
+
MediaView: { propsNames: [] },
|
|
1128
|
+
ExpoAppleAuthenticationButtonSignUpWhiteOutline: { propsNames: ['cornerRadius'] },
|
|
1129
|
+
ExpoAppleAuthenticationButtonContinueBlack: { propsNames: ['cornerRadius'] },
|
|
1130
|
+
ExpoAppleAuthenticationButtonContinueWhite: { propsNames: ['cornerRadius'] },
|
|
1131
|
+
CTKBannerView: { propsNames: ['placementId', 'size'] },
|
|
1132
|
+
AdIconView: { propsNames: [] },
|
|
1133
|
+
CTKNativeAd: { propsNames: ['adsManager'] },
|
|
1134
|
+
ExponentCamera: {
|
|
1135
|
+
propsNames: [
|
|
1136
|
+
'faceDetectorEnabled',
|
|
1137
|
+
'focusDepth',
|
|
1138
|
+
'barCodeScannerEnabled',
|
|
1139
|
+
'faceDetectorSettings',
|
|
1140
|
+
'pictureSize',
|
|
1141
|
+
'zoom',
|
|
1142
|
+
'flashMode',
|
|
1143
|
+
'type',
|
|
1144
|
+
'whiteBalance',
|
|
1145
|
+
'autoFocus',
|
|
1146
|
+
'barCodeScannerSettings',
|
|
1147
|
+
],
|
|
1148
|
+
},
|
|
1149
|
+
ExpoAdsPublisherBannerView: {
|
|
1150
|
+
propsNames: ['additionalRequestParams', 'bannerSize', 'adUnitID'],
|
|
1151
|
+
},
|
|
1152
|
+
},
|
|
1044
1153
|
},
|
|
1045
1154
|
},
|
|
1046
1155
|
RNAWSCognito: {
|
|
@@ -1107,13 +1216,6 @@ module.exports = {
|
|
|
1107
1216
|
getConstants: { type: 'function' },
|
|
1108
1217
|
removeListeners: { type: 'function', functionType: 'async' },
|
|
1109
1218
|
},
|
|
1110
|
-
RNCAppearance: {
|
|
1111
|
-
addListener: { type: 'function', functionType: 'async' },
|
|
1112
|
-
getConstants: { type: 'function' },
|
|
1113
|
-
initialPreferences: { type: 'object' },
|
|
1114
|
-
removeListeners: { type: 'function', functionType: 'async' },
|
|
1115
|
-
},
|
|
1116
|
-
RNCAppearanceProvider: {},
|
|
1117
1219
|
RNCMaskedViewManager: {},
|
|
1118
1220
|
RNCNetInfo: {
|
|
1119
1221
|
addListener: { type: 'function', functionType: 'async' },
|
package/src/preset/setup.js
CHANGED
|
@@ -95,14 +95,16 @@ for (const moduleName of Object.keys(expoModules)) {
|
|
|
95
95
|
});
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
mockNativeModules.NativeUnimoduleProxy.
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
});
|
|
98
|
+
Object.keys(mockNativeModules.NativeUnimoduleProxy.viewManagersMetadata).forEach(
|
|
99
|
+
(viewManagerName) => {
|
|
100
|
+
Object.defineProperty(mockNativeModules.UIManager, `ViewManagerAdapter_${viewManagerName}`, {
|
|
101
|
+
get: () => ({
|
|
102
|
+
NativeProps: {},
|
|
103
|
+
directEventTypes: [],
|
|
104
|
+
}),
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
);
|
|
106
108
|
|
|
107
109
|
const modulesConstants = mockNativeModules.NativeUnimoduleProxy.modulesConstants;
|
|
108
110
|
mockNativeModules.NativeUnimoduleProxy.modulesConstants = {
|