<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "XCTest",
  "identifier" : "/documentation/XCTest/XCTestExpectation/init(description:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "XCTest"
    ],
    "preciseIdentifier" : "c:objc(cs)XCTestExpectation(im)initWithDescription:"
  },
  "title" : "init(description:)"
}
-->

# init(description:)

Creates a new [`XCTestExpectation`](/documentation/XCTest/XCTestExpectation) with the provided description.

```
init(description expectationDescription: String)
```

## Parameters

`expectationDescription`

A string to display in the test log for this expectation, to help diagnose failures.

## Discussion

To fulfill an expectation that was created with this initializer, call the expectation’s [`fulfill()`](/documentation/XCTest/XCTestExpectation/fulfill()) method when the asynchronous task in your test has completed.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)