mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-26 13:25:51 +08:00
Switch out DISABLE_YELLOW_BOX for IS_TESTING
Summary: Switch to using IS_TESTING on the Platform module. While IS_TESTING has to be explicitly set in the test harness, this makes it more usable and stops people from relying on brittle variables in the (larger) environment. Reviewed By: fkgozali Differential Revision: D4423661 fbshipit-source-id: 27a80867778b9374bcba67b69f9c93d32c0a74b0
This commit is contained in:
committed by
Facebook Github Bot
parent
a4bfac907e
commit
81c33b542d
@@ -30,6 +30,11 @@ static NSString *interfaceIdiom(UIUserInterfaceIdiom idiom) {
|
||||
}
|
||||
}
|
||||
|
||||
static BOOL isTestingEnvironment(void) {
|
||||
NSDictionary *environment = [[NSProcessInfo processInfo] environment];
|
||||
return [environment[@"IS_TESTING"] boolValue];
|
||||
}
|
||||
|
||||
RCT_EXPORT_MODULE(IOSConstants)
|
||||
|
||||
- (NSDictionary<NSString *, id> *)constantsToExport
|
||||
@@ -40,6 +45,7 @@ RCT_EXPORT_MODULE(IOSConstants)
|
||||
@"osVersion": [device systemVersion],
|
||||
@"systemName": [device systemName],
|
||||
@"interfaceIdiom": interfaceIdiom([device userInterfaceIdiom]),
|
||||
@"isTesting": @(isTestingEnvironment()),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user