mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
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`](https://github.com/facebook/jest/blob/4670d3be0d80d47844673eb163666253e788f006/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
This commit is contained in:
committed by
Lorenzo Sciandra
parent
4ba52ac555
commit
b34bde2a91
Vendored
+3
-1
@@ -12,5 +12,7 @@
|
||||
const NodeEnv = require('jest-environment-node').TestEnvironment;
|
||||
|
||||
module.exports = class ReactNativeEnv extends NodeEnv {
|
||||
// this is where we'll add our custom logic
|
||||
exportConditions() {
|
||||
return ['react-native'];
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user