Created
July 20, 2016 14:30
-
-
Save jonathan-beebe/a65816ff39ba6ef082257fc745e953b7 to your computer and use it in GitHub Desktop.
A template for async swift tests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import XCTest | |
@testable import {AppTarget} | |
class TestCase: XCTestCase { | |
func testCode() { | |
let expectation = expectationWithDescription("test description") | |
var result: Bool? | |
// Setup the the test here | |
// Perform the testable action | |
// Wait for async work to complete | |
waitForExpectationsWithTimeout(5) { error in | |
// Asserts here | |
XCTAssertTrue(result) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment