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:
Christopher Chedeau
2015-03-25 10:16:19 -07:00
parent 3aee972116
commit d6a921e94d
14 changed files with 139 additions and 18 deletions

View File

@@ -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