@react-native/jest-preset 0.87.0-rc.0 → 0.87.0-rc.2

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 CHANGED
@@ -36,9 +36,3 @@ module.exports = {
36
36
  ```
37
37
 
38
38
  You can further customize your Jest configuration by specifying other options. See [Jest's `jest.config.js` documentation](https://jestjs.io/docs/configuration) to learn more.
39
-
40
- ### Migration Note
41
-
42
- This Jest preset used to be part of the core `react-native` package and accessible at `react-native/jest-preset.js`. As long as `@react-native/jest-preset` is installed, `react-native/jest-preset.js` will be aliased to this package and continue to work but is deprecated.
43
-
44
- Follow the installation instructions above to migrate to `@react-native/jest-preset` and change `preset: 'react-native'` to `preset: '@react-native/jest-preset` to migrate.
package/jest/setup.js CHANGED
@@ -133,6 +133,7 @@ mock(
133
133
  'm#react-native/Libraries/Core/InitializeCore',
134
134
  'm#./mocks/InitializeCore',
135
135
  );
136
+ mock('m#react-native/setup-env', 'm#./mocks/InitializeCore');
136
137
  mock('m#react-native/Libraries/Core/NativeExceptionsManager');
137
138
  mock('m#react-native/Libraries/Image/Image', 'm#./mocks/Image');
138
139
  mock(
package/jest-preset.js CHANGED
@@ -18,6 +18,11 @@ module.exports = {
18
18
  platforms: ['android', 'ios', 'native'],
19
19
  },
20
20
  moduleNameMapper: {
21
+ // `setup-env` is a secondary entry point exposed via the package's
22
+ // `exports`, but `./jest/resolver.js` strips `exports` and the generic
23
+ // mapper below resolves subpaths as literal directory paths. Alias it
24
+ // explicitly so it resolves to its `src/` implementation.
25
+ '^react-native/setup-env$': `${path.dirname(require.resolve('react-native'))}/src/setup-env.js`,
21
26
  '^react-native($|/.*)': `${path.dirname(require.resolve('react-native'))}/$1`,
22
27
  },
23
28
  resolver: require.resolve('./jest/resolver.js'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-native/jest-preset",
3
- "version": "0.87.0-rc.0",
3
+ "version": "0.87.0-rc.2",
4
4
  "description": "Jest preset for React Native apps",
5
5
  "keywords": [
6
6
  "jest",
@@ -29,7 +29,7 @@
29
29
  ],
30
30
  "dependencies": {
31
31
  "@jest/create-cache-key-function": "^29.7.0",
32
- "@react-native/js-polyfills": "0.87.0-rc.0",
32
+ "@react-native/js-polyfills": "0.87.0-rc.2",
33
33
  "babel-jest": "^29.7.0",
34
34
  "jest-environment-node": "^29.7.0",
35
35
  "regenerator-runtime": "^0.13.2"