From 241091d527ae7e1866c3f9bdf067cde146e377fa Mon Sep 17 00:00:00 2001 From: Kevin Gozali Date: Wed, 4 Sep 2019 09:14:16 -0700 Subject: [PATCH] TM iOS: Disable in test environment Summary: For now, disable TM completely in test environment, like RNTester integration/unit tests. See details in T53341772 This also fixes the failure discussed in https://github.com/facebook/react-native/pull/26151 Reviewed By: PeteTheHeat Differential Revision: D17147915 fbshipit-source-id: 1c48ebb9c3b81fc08bc33606dcc38c29297d6010 --- React/Base/RCTBridge.m | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/React/Base/RCTBridge.m b/React/Base/RCTBridge.m index 0d51ae510bcdbf..3475e767090d34 100644 --- a/React/Base/RCTBridge.m +++ b/React/Base/RCTBridge.m @@ -93,6 +93,12 @@ void RCTRegisterModule(Class moduleClass) static BOOL turboModuleEnabled = NO; BOOL RCTTurboModuleEnabled(void) { +#if RCT_DEBUG + // TODO(T53341772): Allow TurboModule for test environment. Right now this breaks RNTester tests if enabled. + if (RCTRunningInTestEnvironment()) { + return NO; + } +#endif return turboModuleEnabled; }