From 7e23c7c5654818fa076eeb627b709d39130f57f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pierzcha=C5=82a?= Date: Wed, 3 Apr 2019 09:07:07 -0700 Subject: [PATCH] Make Jest transform @react-native-community packages by default (#24294) Summary: Currently, `react-native` Jest preset will not automatically transpile extracted Lean Core modules (all under `react-native-community` org), so maintainers will likely need to update their docs on how to do that (it's a common pain in RN testing story). We can make it easier for users and maintainers by adding RNC modules to the `transformIgnorePatterns` whitelist we have in Jest preset. Some of them are not necessary to transpile, but I'd say it's a small sacrifice to make (having first test run possibly slower) for having less friction around migrating to extracted modules. [General] [Added] - make Jest transform react-native-community/ packages by default Pull Request resolved: https://github.com/facebook/react-native/pull/24294 Differential Revision: D14748962 Pulled By: cpojer fbshipit-source-id: 36300ee021f03b8c13275a6e0cf28d988ee5beba --- jest-preset.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jest-preset.js b/jest-preset.js index 8e1db98cf8206c..3de412bebd571e 100644 --- a/jest-preset.js +++ b/jest-preset.js @@ -28,7 +28,9 @@ module.exports = { './jest/assetFileTransformer.js', ), }, - transformIgnorePatterns: ['node_modules/(?!(jest-)?react-native)'], + transformIgnorePatterns: [ + 'node_modules/(?!(jest-)?react-native|@react-native-community)', + ], setupFiles: [require.resolve('./jest/setup.js')], testEnvironment: 'node', };