<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "XCTest",
  "identifier" : "/documentation/XCTest/XCTestObservation/testSuite(_:didRecord:)-1xjkv",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "XCTest"
    ],
    "preciseIdentifier" : "c:objc(pl)XCTestObservation(im)testSuite:didRecordExpectedFailure:"
  },
  "title" : "testSuite(_:didRecord:)"
}
-->

# testSuite(_:didRecord:)

Notifies the observer when a test suite records an expected failure.

```
optional func testSuite(_ testSuite: XCTestSuite, didRecord expectedFailure: XCTExpectedFailure)
```

## Parameters

`testSuite`

The test suite with the expected failure.

`expectedFailure`

The expected failure to record.

---

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)