jest-expo 50.0.2 → 50.0.3
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 +15 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jest-expo",
|
|
3
|
-
"version": "50.0.
|
|
3
|
+
"version": "50.0.3",
|
|
4
4
|
"description": "A Jest preset to painlessly test your Expo / React Native apps.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "src",
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"url": "https://github.com/expo/expo/issues"
|
|
49
49
|
},
|
|
50
50
|
"homepage": "https://github.com/expo/expo/tree/main/packages/jest-expo",
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "e5e3cc1bfcc9adce4755a0cdda0396077e8e047a"
|
|
52
52
|
}
|
package/src/preset/setup.js
CHANGED
|
@@ -18,6 +18,21 @@ if (typeof window !== 'object') {
|
|
|
18
18
|
globalThis.window.navigator = {};
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
if (typeof globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') {
|
|
22
|
+
// RN 0.74 checks for the __REACT_DEVTOOLS_GLOBAL_HOOK__ on startup if getInspectorDataForViewAtPoint is used
|
|
23
|
+
// React Navigation uses getInspectorDataForViewAtPoint() for improved log box integration in non-production builds
|
|
24
|
+
globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__ = {
|
|
25
|
+
isDisabled: true, // Used by `react-test-renderer` https://github.com/facebook/react/blob/113ab9af08c46e8a548a397154f5c9dfeb96ab6a/packages/react-reconciler/src/ReactFiberDevToolsHook.js#L60
|
|
26
|
+
renderers: {
|
|
27
|
+
// https://github.com/facebook/react-native/blob/fbbb4246707d85b692c006e0cb3b186a7c9068bc/packages/react-native/Libraries/Inspector/getInspectorDataForViewAtPoint.js#L40
|
|
28
|
+
values: () => [],
|
|
29
|
+
},
|
|
30
|
+
on() {}, // https://github.com/facebook/react-native/blob/fbbb4246707d85b692c006e0cb3b186a7c9068bc/packages/react-native/Libraries/Inspector/getInspectorDataForViewAtPoint.js#L45
|
|
31
|
+
};
|
|
32
|
+
// React is inconsistent with how it checks for the global hook
|
|
33
|
+
globalThis.window.__REACT_DEVTOOLS_GLOBAL_HOOK__ = globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;
|
|
34
|
+
}
|
|
35
|
+
|
|
21
36
|
const mockImageLoader = {
|
|
22
37
|
configurable: true,
|
|
23
38
|
enumerable: true,
|