Skip to content

Commit

Permalink
Add WaitUnitll
Browse files Browse the repository at this point in the history
  • Loading branch information
deda9 committed Jul 17, 2019
1 parent 28ef53c commit b1737a7
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions WaitUntill.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import XCTest

extension XCTestCase {
func waitUntil(timeout: TimeInterval = 5, done: @escaping (@escaping () -> Void) -> Void) {
let expectation = self.expectation(description: "fromAtoB expectation")
done {
expectation.fulfill()
}
waitForExpectations(timeout: timeout, handler: nil)
}
}

0 comments on commit b1737a7

Please sign in to comment.