File tree 2 files changed +6
-10
lines changed
2 files changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -30,11 +30,6 @@ @implementation RCTPlatform
30
30
}
31
31
}
32
32
33
- static BOOL isTestingEnvironment (void ) {
34
- NSDictionary *environment = [[NSProcessInfo processInfo ] environment ];
35
- return [environment[@" IS_TESTING" ] boolValue ];
36
- }
37
-
38
33
RCT_EXPORT_MODULE (PlatformConstants)
39
34
40
35
- (NSDictionary <NSString *, id > *)constantsToExport
@@ -45,7 +40,7 @@ static BOOL isTestingEnvironment(void) {
45
40
@" osVersion" : [device systemVersion ],
46
41
@" systemName" : [device systemName ],
47
42
@" interfaceIdiom" : interfaceIdiom ([device userInterfaceIdiom ]),
48
- @" isTesting" : @(isTestingEnvironment ()),
43
+ @" isTesting" : @(RCTRunningInTestEnvironment ()),
49
44
};
50
45
}
51
46
Original file line number Diff line number Diff line change 9
9
10
10
#import " RCTUtils.h"
11
11
12
+ #import < dlfcn.h>
12
13
#import < mach/mach_time.h>
13
14
#import < objc/message.h>
14
15
#import < objc/runtime.h>
16
+ #import < zlib.h>
15
17
16
18
#import < UIKit/UIKit.h>
17
19
18
20
#import < CommonCrypto/CommonCrypto.h>
19
21
20
- #import < zlib.h>
21
- #import < dlfcn.h>
22
-
23
22
#import " RCTAssert.h"
24
23
#import " RCTLog.h"
25
24
@@ -445,7 +444,9 @@ BOOL RCTRunningInTestEnvironment(void)
445
444
static BOOL isTestEnvironment = NO ;
446
445
static dispatch_once_t onceToken;
447
446
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 ];
449
450
});
450
451
return isTestEnvironment;
451
452
}
You can’t perform that action at this time.
0 commit comments