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
This commit is contained in:
Kevin Gozali
2019-09-10 13:33:40 +02:00
committed by grabbou
parent 0356b1fa13
commit 50d9551f87
+6
View File
@@ -93,6 +93,12 @@ NSString *RCTBridgeModuleNameForClass(Class cls)
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;
}