Skip to content

Latest commit

 

History

History
27 lines (20 loc) · 477 Bytes

README.md

File metadata and controls

27 lines (20 loc) · 477 Bytes

WaitUntil

Its a sugar syntax to use expectation to run asynchronous work on XCTestCase.

It replaces:

let imageLoader = ImageLoader()
let completedExpectation = expectation(description: "Completed")

imageLoader.download { image in
    completedExpectation.fulfill()
}

waitForExpectations(timeout: 0.3, handler: nil)

with:

let imageLoader = ImageLoader()

waitUnilt { done in
    imageLoader.download { image in
        done()
    }
}