Skip to content

Sugar syntax to use expectation to run asynchronous work on XCTestCase

Notifications You must be signed in to change notification settings

deda9/WaitUntil

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

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()
    }
}

About

Sugar syntax to use expectation to run asynchronous work on XCTestCase

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages