Skip to content

Instantly share code, notes, and snippets.

@gkye
Created August 23, 2019 15:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gkye/e465ab2dc0b5dbe88ecb5daa4599f482 to your computer and use it in GitHub Desktop.
Save gkye/e465ab2dc0b5dbe88ecb5daa4599f482 to your computer and use it in GitHub Desktop.
extension XCTestCase {
func asyncExpectation(description: String, timeout: TimeInterval = 10, completion: (XCTestExpectation) -> ()) {
let promise = expectation(description: description)
completion(promise)
waitForExpectations(timeout: timeout, handler: nil)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment