<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "XCTest",
  "identifier" : "/documentation/XCTest/XCTestError/Code",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "XCTest"
    ],
    "preciseIdentifier" : "c:@E@XCTestErrorCode"
  },
  "title" : "XCTestError.Code"
}
-->

# XCTestError.Code

Error codes for errors that can occur while the test is waiting to fulfill expectations.

```
enum Code
```

## Topics

### Error Codes

[`XCTestErrorCodeTimeoutWhileWaiting`](/documentation/XCTest/XCTestError/Code/timeoutWhileWaiting)

A code that represents a timeout the test encountered while waiting to fulfill expectations.

[`XCTestErrorCodeFailureWhileWaiting`](/documentation/XCTest/XCTestError/Code/failureWhileWaiting)

A code that represents a test failure the test encountered while waiting to fulfill expectations.

## Relationships

### Conforms To

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

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

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

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

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

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

---

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)