react-native/jest
Alex Hunt 0a3c55562b Update custom "exports" conditions in Jest environment
Summary:
Updates the default set of `"exports"` condition names in our `ReactNativeEnv` for Jest, so that it aligns with the defaults in React Native CLI (https://github.com/react-native-community/cli/pull/1862).

Also includes a subtle update to how this is accomplished. Instead of overriding `exportConditions()`, we assign to the underlying class property — this allows users (once https://github.com/facebook/jest/pull/13989 is merged) to override `customExportConditions` via [`testEnvironmentOptions`](https://jestjs.io/docs/configuration#testenvironmentoptions-object).

```js
  preset: 'react-native',
  testEnvironmentOptions: {
    customExportConditions: ['test', 'react-native'],
  },
```

Changelog: [Internal]

Reviewed By: jacdebug

Differential Revision: D43879056

fbshipit-source-id: 86fffe2b5fdf9d8492d25b8b12a78be75b5fa3be
2023-03-15 17:18:08 -07:00
..
private Remove babel plugins from jest preprocessor which are part of preset 2022-05-12 03:48:24 -07:00
assetFileTransformer.js fix(jest): make assetFileTransformer return an object (#33756) 2022-06-17 10:27:47 -07:00
local-setup.js Fix Jest failure on console.error() 2023-03-01 06:34:57 -08:00
mockComponent.js Support ES modules in mockComponent 2022-12-28 12:35:03 -08:00
mockModal.js fix(jest/setup): fix circular dependencies in mockModal (#32964) 2022-01-26 23:54:55 -08:00
mockNativeComponent.js ESM requireNativeComponent 2023-01-03 18:09:06 -08:00
MockNativeMethods.js Update copyright headers from Facebook to Meta 2021-12-30 15:11:21 -08:00
mockScrollView.js Revert ESM imports 2023-02-28 10:23:36 -08:00
react-native-env.js Update custom "exports" conditions in Jest environment 2023-03-15 17:18:08 -07:00
renderer.js @emails -> @oncall (remaining ones) 2022-09-15 15:54:10 -07:00
setup.js Provide timestamp as argument to rAF callbacks when running Jest tests (#35919) 2023-01-23 09:53:01 -08:00