<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "XCTest",
  "identifier" : "/documentation/XCTest/XCTExpectedFailure/Options",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "XCTest"
    ],
    "preciseIdentifier" : "c:objc(cs)XCTExpectedFailureOptions"
  },
  "title" : "XCTExpectedFailure.Options"
}
-->

# XCTExpectedFailure.Options

Options that determine how the test matches the expected failure to an actual test failure, and whether an unfulfilled expected failure results in a test failure.

```
class Options
```

## Overview

Create options and provide them to `XCTExpectFailure` functions to tell the test system how to match an expected failure, whether to enable an expected failure during a test, and whether an unfulfilled expected failure generates a test failure.

## Topics

### Matching Failures

[`issueMatcher`](/documentation/XCTest/XCTExpectedFailure/Options/issueMatcher)

A block of code that determines whether the test issue fulfills the expected failure.

### Specifying Options

[`+  nonStrictOptions`](/documentation/XCTest/XCTExpectedFailure/Options/nonStrict())

Options that specify that an unfulfilled expected failure doesn’t generate a test failure.

[`enabled`](/documentation/XCTest/XCTExpectedFailure/Options/isEnabled)

A Boolean value that indicates whether the test checks for the expected failure.

[`strict`](/documentation/XCTest/XCTExpectedFailure/Options/isStrict)

A Boolean value that indicates whether the test reports an error if the expected failure doesn’t occur.

## Relationships

### Conforms To

[`Equatable`](/documentation/Swift/Equatable)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`Hashable`](/documentation/Swift/Hashable)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`NSCoding`](/documentation/Foundation/NSCoding)

[`CVarArg`](/documentation/Swift/CVarArg)

[`NSSecureCoding`](/documentation/Foundation/NSSecureCoding)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`NSCopying`](/documentation/Foundation/NSCopying)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

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)