Skip to content

Instantly share code, notes, and snippets.

@ArchieR7
Created June 16, 2017 05:39
Show Gist options
  • Save ArchieR7/560aa255d38218c11452fa6c8832f3f3 to your computer and use it in GitHub Desktop.
Save ArchieR7/560aa255d38218c11452fa6c8832f3f3 to your computer and use it in GitHub Desktop.
unit test with async functions
func testAsyncFunction() {
let exp = expectation(description: "Async Expectation")
NetworkManager.shared.update(data: Data(), completeHandler: {
exp.fulfill()
})
waitForExpectations(timeout: 30, handler: nil)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment