mirror of
https://github.com/status-im/react-native.git
synced 2025-01-13 11:05:21 +00:00
Log to console in RCTTestRunner
Reviewed By: fkgozali Differential Revision: D4875352 fbshipit-source-id: 68f9caf4f350d34b2fd180ff19353c698bfce452
This commit is contained in:
parent
eeddef18b8
commit
8dcef96fd8
@ -51,6 +51,9 @@ RCT_EXPORT_METHOD(verifySnapshot:(RCTResponseSenderBlock)callback)
|
||||
selector:self->_testSelector
|
||||
identifier:identifier
|
||||
error:&error];
|
||||
if (!success) {
|
||||
RCTLogInfo(@"Failed to verify snapshot %@ (error: %@)", identifier, error);
|
||||
}
|
||||
callback(@[@(success)]);
|
||||
}];
|
||||
}
|
||||
|
@ -97,9 +97,12 @@ expectErrorBlock:(BOOL(^)(NSString *error))expectErrorBlock
|
||||
{
|
||||
@autoreleasepool {
|
||||
__block NSString *error = nil;
|
||||
RCTLogFunction defaultLogFunction = RCTGetLogFunction();
|
||||
RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) {
|
||||
if (level >= RCTLogLevelError) {
|
||||
error = message;
|
||||
} else {
|
||||
defaultLogFunction(level, source, fileName, lineNumber, message);
|
||||
}
|
||||
});
|
||||
|
||||
@ -137,7 +140,7 @@ expectErrorBlock:(BOOL(^)(NSString *error))expectErrorBlock
|
||||
|
||||
[rootView removeFromSuperview];
|
||||
|
||||
RCTSetLogFunction(RCTDefaultLogFunction);
|
||||
RCTSetLogFunction(defaultLogFunction);
|
||||
|
||||
NSArray<UIView *> *nonLayoutSubviews = [vc.view.subviews filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(id subview, NSDictionary *bindings) {
|
||||
return ![NSStringFromClass([subview class]) isEqualToString:@"_UILayoutGuide"];
|
||||
|
Loading…
x
Reference in New Issue
Block a user