Fix to run RealmReactTests with release builds
In the case of a release build, React Native will not include the RCTWebSocketExecutor.
This commit is contained in:
parent
6c6931a97d
commit
84b419c815
|
@ -36,7 +36,9 @@ extern void JSGlobalContextSetIncludesNativeCallStackWhenReportingExceptions(JSG
|
|||
|
||||
+ (id<RCTJavaScriptExecutor>)currentExecutor {
|
||||
Class executorClass = [self executorClass];
|
||||
assert(executorClass);
|
||||
if (!executorClass) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
static RCTBridge *s_bridge;
|
||||
if (!s_bridge) {
|
||||
|
@ -63,8 +65,14 @@ extern void JSGlobalContextSetIncludesNativeCallStackWhenReportingExceptions(JSG
|
|||
}
|
||||
|
||||
+ (XCTestSuite *)defaultTestSuite {
|
||||
XCTestSuite *suite = [super defaultTestSuite];
|
||||
id<RCTJavaScriptExecutor> executor = [self currentExecutor];
|
||||
|
||||
// The executor may be nil if the executorClass was not found (i.e. release build).
|
||||
if (!executor) {
|
||||
return suite;
|
||||
}
|
||||
|
||||
// FIXME: Remove this nonsense once the crashes go away when a test fails!
|
||||
JSGlobalContextRef ctx = RealmReactGetJSGlobalContextForExecutor(executor, false);
|
||||
if (ctx) {
|
||||
|
@ -88,7 +96,6 @@ extern void JSGlobalContextSetIncludesNativeCallStackWhenReportingExceptions(JSG
|
|||
testCaseNames = renamedTestCaseNames;
|
||||
}
|
||||
|
||||
XCTestSuite *suite = [super defaultTestSuite];
|
||||
for (XCTestSuite *testSuite in [self testSuitesFromDictionary:testCaseNames]) {
|
||||
[suite addTest:testSuite];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue