Mark an XCTest method `async throws` and call the asynchronous API with `try await` directly: ```swift final class APIClientTests: XCTestCase { func testFetchUser() async throws { let client = APIClient(transport: StubTransport()) let user = try await client.fetchUser() XCTAssertEqual(user.id, 42) } } ``` Use structured async APIs rather than `Thread.sleep`. If the code is callback-based, bridge or test it with an `XCTestExpectation` and a reasonable timeout.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Swift Testing?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/hoangnguyen0403-swift-testing-1a340a36)
Mark an XCTest method `async throws` and call the asynchronous API with `try await` directly:
```swift
final class APIClientTests: XCTestCase {
func testFetchUser() async throws {
let client = APIClient(transport: StubTransport())
let user = try await client.fetchUser()
XCTAssertEqual(user.id, 42)
}
}
```
Use structured async APIs rather than `Thread.sleep`. If the code is callback-based, bridge or test it with an `XCTestExpectation` and a reasonable timeout.