File tree Expand file tree Collapse file tree 2 files changed +6
-10
lines changed
Expand file tree Collapse file tree 2 files changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -30,11 +30,6 @@ @implementation RCTPlatform
3030 }
3131}
3232
33- static BOOL isTestingEnvironment (void ) {
34- NSDictionary *environment = [[NSProcessInfo processInfo ] environment ];
35- return [environment[@" IS_TESTING" ] boolValue ];
36- }
37-
3833RCT_EXPORT_MODULE (PlatformConstants)
3934
4035- (NSDictionary <NSString *, id > *)constantsToExport
@@ -45,7 +40,7 @@ static BOOL isTestingEnvironment(void) {
4540 @" osVersion" : [device systemVersion ],
4641 @" systemName" : [device systemName ],
4742 @" interfaceIdiom" : interfaceIdiom ([device userInterfaceIdiom ]),
48- @" isTesting" : @(isTestingEnvironment ()),
43+ @" isTesting" : @(RCTRunningInTestEnvironment ()),
4944 };
5045}
5146
Original file line number Diff line number Diff line change 99
1010#import " RCTUtils.h"
1111
12+ #import < dlfcn.h>
1213#import < mach/mach_time.h>
1314#import < objc/message.h>
1415#import < objc/runtime.h>
16+ #import < zlib.h>
1517
1618#import < UIKit/UIKit.h>
1719
1820#import < CommonCrypto/CommonCrypto.h>
1921
20- #import < zlib.h>
21- #import < dlfcn.h>
22-
2322#import " RCTAssert.h"
2423#import " RCTLog.h"
2524
@@ -445,7 +444,9 @@ BOOL RCTRunningInTestEnvironment(void)
445444 static BOOL isTestEnvironment = NO ;
446445 static dispatch_once_t onceToken;
447446 dispatch_once (&onceToken, ^{
448- isTestEnvironment = objc_lookUpClass (" SenTestCase" ) || objc_lookUpClass (" XCTest" );
447+ NSDictionary *environment = [[NSProcessInfo processInfo ] environment ];
448+ isTestEnvironment = objc_lookUpClass (" SenTestCase" ) || objc_lookUpClass (" XCTest" ) ||
449+ [environment[@" IS_TESTING" ] boolValue ];
449450 });
450451 return isTestEnvironment;
451452}
You can’t perform that action at this time.
0 commit comments