From 681d7f8113d2b5e9d6966255ee6c72b50a7d488a Mon Sep 17 00:00:00 2001 From: Alex Hunt Date: Thu, 16 Mar 2023 04:57:16 -0700 Subject: [PATCH] Hotfix for Jest preset changes in 0a3c555 (#36495) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/36495 It looks like Jest is not running `babel/transform-modules-commonjs` on all files, and therefore when including `"import"` as a Package Exports condition in Jest, this misbehaved (https://github.com/facebook/react-native/commit/0a3c55562b5ba43b00c21ca4d7b2cba0c8eb6206). This is a hotfix to restore CI stability. Changelog: [Fix][Internal] Hotfix adjusting Jest changes added in https://github.com/facebook/react-native/commit/0a3c55562b5ba43b00c21ca4d7b2cba0c8eb6206 Reviewed By: cipolleschi, hoxyq Differential Revision: D44130442 fbshipit-source-id: 6407519d0d5459ef422afe21be26a2e3141bedf3 --- jest/react-native-env.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jest/react-native-env.js b/jest/react-native-env.js index c699a97d0df3a7..494bb884ef4582 100644 --- a/jest/react-native-env.js +++ b/jest/react-native-env.js @@ -12,5 +12,5 @@ const NodeEnv = require('jest-environment-node').TestEnvironment; module.exports = class ReactNativeEnv extends NodeEnv { - customExportConditions = ['import', 'require', 'react-native']; + customExportConditions = ['require', 'react-native']; };