[ReactNative] Fail faster in OSS tests
This commit is contained in:
parent
d177a45bdc
commit
ee449301b6
|
@ -44,8 +44,8 @@
|
||||||
NSString *redboxError = nil;
|
NSString *redboxError = nil;
|
||||||
|
|
||||||
while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) {
|
while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) {
|
||||||
[[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:date];
|
[[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
|
||||||
[[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:date];
|
[[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
|
||||||
|
|
||||||
redboxError = [[RCTRedBox sharedInstance] currentErrorMessage];
|
redboxError = [[RCTRedBox sharedInstance] currentErrorMessage];
|
||||||
|
|
||||||
|
|
|
@ -69,8 +69,9 @@
|
||||||
NSString *redboxError = nil;
|
NSString *redboxError = nil;
|
||||||
|
|
||||||
while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) {
|
while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) {
|
||||||
[[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:date];
|
[[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
|
||||||
[[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:date];
|
[[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
|
||||||
|
|
||||||
redboxError = [[RCTRedBox sharedInstance] currentErrorMessage];
|
redboxError = [[RCTRedBox sharedInstance] currentErrorMessage];
|
||||||
foundElement = [self findSubviewInView:vc.view matching:^(UIView *view) {
|
foundElement = [self findSubviewInView:vc.view matching:^(UIView *view) {
|
||||||
if ([view respondsToSelector:@selector(attributedText)]) {
|
if ([view respondsToSelector:@selector(attributedText)]) {
|
||||||
|
|
|
@ -84,8 +84,8 @@
|
||||||
NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS];
|
NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS];
|
||||||
NSString *error = [[RCTRedBox sharedInstance] currentErrorMessage];
|
NSString *error = [[RCTRedBox sharedInstance] currentErrorMessage];
|
||||||
while ([date timeIntervalSinceNow] > 0 && ![testModule isDone] && error == nil) {
|
while ([date timeIntervalSinceNow] > 0 && ![testModule isDone] && error == nil) {
|
||||||
[[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:date];
|
[[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
|
||||||
[[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:date];
|
[[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
|
||||||
error = [[RCTRedBox sharedInstance] currentErrorMessage];
|
error = [[RCTRedBox sharedInstance] currentErrorMessage];
|
||||||
}
|
}
|
||||||
[rootView removeFromSuperview];
|
[rootView removeFromSuperview];
|
||||||
|
|
Loading…
Reference in New Issue