mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-07 02:08:34 +08:00
Updates from Wed 25 Mar
- [ReactNative] Add snapshot tests for examples | Spencer Ahrens - [ReactNative] bring back some native modules | Spencer Ahrens
This commit is contained in:
@@ -39,22 +39,26 @@
|
||||
return;
|
||||
}
|
||||
|
||||
NSError *error = nil;
|
||||
NSString *testName = NSStringFromSelector(_testSelector);
|
||||
_snapshotCounter[testName] = @([_snapshotCounter[testName] integerValue] + 1);
|
||||
BOOL success = [_snapshotController compareSnapshotOfView:_view
|
||||
selector:_testSelector
|
||||
identifier:[_snapshotCounter[testName] stringValue]
|
||||
error:&error];
|
||||
RCTAssert(success, @"Snapshot comparison failed: %@", error);
|
||||
callback(@[]);
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
NSString *testName = NSStringFromSelector(_testSelector);
|
||||
_snapshotCounter[testName] = @([_snapshotCounter[testName] integerValue] + 1);
|
||||
NSError *error = nil;
|
||||
BOOL success = [_snapshotController compareSnapshotOfView:_view
|
||||
selector:_testSelector
|
||||
identifier:[_snapshotCounter[testName] stringValue]
|
||||
error:&error];
|
||||
RCTAssert(success, @"Snapshot comparison failed: %@", error);
|
||||
callback(@[]);
|
||||
});
|
||||
}
|
||||
|
||||
- (void)markTestCompleted
|
||||
{
|
||||
RCT_EXPORT();
|
||||
|
||||
_done = YES;
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
_done = YES;
|
||||
});
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user