jest-expo 50.0.2 → 50.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jest-expo",
3
- "version": "50.0.2",
3
+ "version": "50.0.4",
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": "4f3dcf3e23eae997f884117fdd34ad734efad9fd"
51
+ "gitHead": "d846eb40fc384b9e4b21260af2a990dfe79cf461"
52
52
  }
@@ -18,6 +18,22 @@ 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
+ off() {},
32
+ };
33
+ // React is inconsistent with how it checks for the global hook
34
+ globalThis.window.__REACT_DEVTOOLS_GLOBAL_HOOK__ = globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;
35
+ }
36
+
21
37
  const mockImageLoader = {
22
38
  configurable: true,
23
39
  enumerable: true,