Update AnyPromiseTests.m
This commit is contained in:
parent
9cd56c237d
commit
6303e93089
@ -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 {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user