expectation(description:)
Creates a new expectation with an associated description.
Declaration
func expectation(description: String) -> XCTestExpectationParameters
- description:
A string to display in the test log for this expectation, to help diagnose failures.
Discussion
Use this method to create XCTestExpectation instances that can be fulfilled when asynchronous tasks in your tests complete.
To fulfill an expectation that was created with expectation(description:), call the expectation’s fulfill() method when the asynchronous task in your test has completed.
See Also
Creating Asynchronous Test Expectations
expectation(for:evaluatedWith:handler:)expectation(forNotification:object:handler:)expectation(forNotification:object:notificationCenter:handler:)keyValueObservingExpectation(for:keyPath:expectedValue:)expectation(that:on:options:willEqual:)keyValueObservingExpectation(for:keyPath:handler:)expectation(that:on:options:willSatisfy:)expectation(that:on:options:willSatisfy:)expectation(that:on:options:willSatisfy:)