Fixed release builds on UIExplorer

This commit is contained in:
Nick Lockwood
2015-04-21 18:26:26 -07:00
parent 368e507b38
commit b1a15004de
2 changed files with 11 additions and 0 deletions

View File

@@ -10,6 +10,7 @@
#import <UIKit/UIKit.h>
#import "RCTBridgeModule.h"
#import "RCTDefines.h"
@class FBSnapshotTestController;

View File

@@ -10,6 +10,7 @@
#import "RCTTestRunner.h"
#import "FBSnapshotTestController.h"
#import "RCTDefines.h"
#import "RCTRedBox.h"
#import "RCTRootView.h"
#import "RCTTestModule.h"
@@ -75,6 +76,8 @@
vc.view = [[UIView alloc] init];
[vc.view addSubview:rootView]; // Add as subview so it doesn't get resized
#if RCT_DEBUG // Prevents build errors, as RCTRedBox is underfined if RCT_DEBUG=0
NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS];
NSString *error = [[RCTRedBox sharedInstance] currentErrorMessage];
while ([date timeIntervalSinceNow] > 0 && ![testModule isDone] && error == nil) {
@@ -95,6 +98,13 @@
} else {
RCTAssert([testModule isDone], @"Test didn't finish within %d seconds", TIMEOUT_SECONDS);
}
#else
expectErrorBlock(@"RCTRedBox unavailable. Set RCT_DEBUG=1 for testing.");
#endif
}
@end