You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment, to use the report with XCTest you have to have a setup similar to this:
- (void)testBridge {
// Make a new expectation
XCTestExpectation *expectation = [[XCTestExpectation alloc] initWithDescription:@"Cavy tests passed"];
[CavyNativeReporter onFinishWithBlock: ^void(NSDictionary* report) {
long errorCount = [report[@"errorCount"] integerValue];
if (errorCount > 0) {
XCTFail(@"Cavy tests had one or more errors");
}
[expectation fulfill];
}];
[selfwaitForExpectations:@[expectation] timeout:60];
}
Fulfilling the expectation within the block passed to Cavy and waiting on those expectations with [self waitForExpectations:@[expectation] timeout:60];
It would be better to be able to do something like this:
- (void)testBridge {
[CavyNativeReporter waitForReport:5];
// Pull the error count from the report object.NSDictionary *report = CavyNativeReporter.cavyReport;
long errorCount = [report[@"errorCount"] integerValue];
XCTAssertEqual(errorCount, 0);
}
This might be achievable by adopting a similar technique to the Android module, making the report a public property on the class, and waiting on a Dispatch Group.
Would be great to achieve this without coupling the reporter to XCTest, but that might be tricky.
The text was updated successfully, but these errors were encountered:
At the moment, to use the report with XCTest you have to have a setup similar to this:
Fulfilling the expectation within the block passed to Cavy and waiting on those expectations with
[self waitForExpectations:@[expectation] timeout:60];
It would be better to be able to do something like this:
This might be achievable by adopting a similar technique to the Android module, making the report a public property on the class, and waiting on a Dispatch Group.
Would be great to achieve this without coupling the reporter to XCTest, but that might be tricky.
The text was updated successfully, but these errors were encountered: