Update AnyPromiseTests.m

This commit is contained in:
Roman Podymov 2019-06-28 12:58:15 +02:00 committed by GitHub
parent 9cd56c237d
commit 6303e93089
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -757,28 +757,20 @@ static inline AnyPromise *fulfillLater() {
[self waitForExpectationsWithTimeout:1 handler:nil];
}
- (void)test_61_wait_for_value {
id ex1 = [self expectationWithDescription:@""];
- (void)test_61_wait_for_value {
id o = [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) {
resolve(@1);
}].wait;
XCTAssertEqualObjects(o, @1);
[ex1 fulfill];
[self waitForExpectationsWithTimeout:1 handler:nil];
}
- (void)test_62_wait_for_error {
id ex1 = [self expectationWithDescription:@""];
NSError* err = [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) {
resolve([NSError errorWithDomain:@"a" code:123 userInfo:nil]);
}].wait;
XCTAssertEqual(err.code, 123);
[ex1 fulfill];
[self waitForExpectationsWithTimeout:1 handler:nil];
}
- (void)test_properties {