Граф коммитов

2 Коммитов

Автор SHA1 Сообщение Дата
Simen Bekkhus 0376aa4856 fix(jest-env): pass `exportConditions` (#35203)
Summary:
Like discussed in https://github.com/react-native-community/discussions-and-proposals/issues/509, RN should override the default `node` and `node-addons` conditions.

You might consider supporting (or just setting) [`customExportConditions`](4670d3be0d/packages/jest-environment-node/src/index.ts (L187-L189)) instead, but the default of the node env should be overwritten 🙂

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[General] [Changed] - use `'react-native'` export conditions in Jest environment

Pull Request resolved: https://github.com/facebook/react-native/pull/35203

Test Plan: Green CI?

Reviewed By: lunaleaps

Differential Revision: D41081783

Pulled By: jacdebug

fbshipit-source-id: 844c70d92a58c5432ba5b9e5e99c8f50045ef8ac
2022-11-10 06:21:53 -08:00
Lorenzo Sciandra cb2dcd327c feat(jest): move Jest config to use a custom react-native Jest env (#34971)
Summary:
This PR is the follow up to the conversation started here by SimenB: https://github.com/react-native-community/discussions-and-proposals/issues/509

Basically, we want to move RN to use its own custom environment so that we can tweak it going forward - this PR in fact only sets up the groundwork for that; robhogan mentioned that with this in place, Meta engineers can
> iterate on it (with jest-environment-node as a starting point) against our internal product tests

This is also connected to Rob's work to bring Jest 29 into the codebase https://github.com/facebook/react-native/pull/34724 and my "mirror" PR to bring template in main up to the same version (https://github.com/facebook/react-native/pull/34972)

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[General] [Changed] - move Jest config to use a custom react-native Jest env

Pull Request resolved: https://github.com/facebook/react-native/pull/34971

Test Plan: Tested that `yarn test` in main works fine after the changes; CI and Meta's internal CI will also serve the purpose of verifying that it works (but there's no reason not to since it's still pretty much just relying on `node`).

Reviewed By: huntie

Differential Revision: D40379760

Pulled By: robhogan

fbshipit-source-id: 2c6d0bc86d337fda9befce0799bda2f56cc4466c
2022-10-17 12:40:25 -07:00