From 68936903db1b49c3659693abcb52451116bbbdf0 Mon Sep 17 00:00:00 2001 From: Chris Bobbe Date: Wed, 1 Sep 2021 17:46:29 -0700 Subject: [PATCH] jest: Also compile modules in @react-native, which we'll see with RN v0.64. This would be handled already if our transformIgnorePatterns extended the transformIgnorePatterns in React Native's Jest preset, because that preset was adapted in facebook/react-native@a77f2c40d, released in RN v0.64. It would also be handled already if our transformIgnorePatterns extended the transformIgnorePatterns in `jest-expo`'s Jest preset after *that* preset was adapted, in the (as-yet-unreleased) change in expo/expo@24bce422c. But we ignore and clobber transformIgnorePatterns in those presets, because the API just isn't suitable to taking a list from elsewhere and extending it [1]. So we add this line ourselves. Since we're upgrading RN before taking that `jest-expo` change, we'll see the following harmless warning for a while when we run Jest: react-native/jest-preset contained different transformIgnorePatterns than expected. It's harmless because we don't use `jest-expo`'s transformIgnorePatterns anyway; we fully specify our own instead. [1] https://github.com/zulip/zulip-mobile/pull/4991#discussion_r704705289 Related: #4426 --- jest.config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/jest.config.js b/jest.config.js index 672f732bbd2..4204985ff6e 100644 --- a/jest.config.js +++ b/jest.config.js @@ -7,6 +7,7 @@ const transformModulesWhitelist = [ 'expo-application', 'expo-web-browser', 'react-native', + '@react-native', // @rnc/async-storage itself is precompiled, but its mock-helper is not '@react-native-async-storage/async-storage', '@react-native-community/cameraroll',