Skip to content

Instantly share code, notes, and snippets.

@jonathan-beebe
Created July 20, 2016 14:30
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 jonathan-beebe/a65816ff39ba6ef082257fc745e953b7 to your computer and use it in GitHub Desktop.
Save jonathan-beebe/a65816ff39ba6ef082257fc745e953b7 to your computer and use it in GitHub Desktop.
A template for async swift tests
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