jest-expo 58.0.7 → 58.0.8

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.
@@ -109,6 +109,8 @@ function getPlatformPreset(displayOptions, extensions, platform, { isServer, isR
109
109
  '^(\\.{1,2}/.*)\\.js$': '$1',
110
110
  // See the note in `../jest-preset.js`: mapped targets must be absolute paths on Jest 30.
111
111
  '^react-native/asset-registry$': expoPreset.moduleNameMapper['^react-native/asset-registry$'],
112
+ '^react-native/unstable-internals-do-not-use$':
113
+ expoPreset.moduleNameMapper['^react-native/unstable-internals-do-not-use$'],
112
114
  ...preset.moduleNameMapper,
113
115
  };
114
116
 
package/jest-preset.js CHANGED
@@ -40,10 +40,21 @@ const reactNativeAssetRegistry = path.join(
40
40
  path.dirname(require.resolve('react-native/package.json')),
41
41
  'src/asset-registry.js'
42
42
  );
43
+ // Resolve from the upstream preset so the entry point's relative requires load the same
44
+ // `react-native` copy its mocks are registered against.
45
+ const reactNativeUnstableInternals = path.join(
46
+ path.dirname(
47
+ require.resolve('react-native/package.json', {
48
+ paths: [path.dirname(require.resolve('@react-native/jest-preset/package.json'))],
49
+ })
50
+ ),
51
+ 'src/unstable-internals-do-not-use.js'
52
+ );
43
53
 
44
54
  // Emulate the alias behavior of Expo's Metro resolver.
45
55
  jestPreset.moduleNameMapper = {
46
56
  '^react-native/asset-registry$': reactNativeAssetRegistry,
57
+ '^react-native/unstable-internals-do-not-use$': reactNativeUnstableInternals,
47
58
  ...(jestPreset.moduleNameMapper || {}),
48
59
  '^react-native-vector-icons$': '@expo/vector-icons',
49
60
  '^react-native-vector-icons/(.*)': '@expo/vector-icons/$1',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jest-expo",
3
- "version": "58.0.7",
3
+ "version": "58.0.8",
4
4
  "description": "A Jest preset to painlessly test your Expo / React Native apps.",
5
5
  "homepage": "https://github.com/expo/expo/tree/main/packages/jest-expo",
6
6
  "bugs": {