
Swift Testing
This walks you through Swift Testing, Apple's macro-based replacement for XCTest. It covers the #expect/#require distinction (most checks should use #expect, not #require), async testing without the Task wrapper nonsense, and parameterized tests with zip to avoid accidental Cartesian products. The migration table from XCTest assertions is handy if you're converting existing tests. Biggest gotcha: tests run in parallel by default, so you'll need .serialized for anything touching shared state. Good reference if you're tired of XCTest's verbosity or finally moving a real codebase to the new framework.
- skills.sh installs
- 209
- GitHub stars
- 233
- last updated
- Aug 21, 2026
Install
$ npx -y skills add johnrogers/claude-swift-engineering --skill swift-testing --agent claude-codeInstalls into .claude/skills of the current project.
Files
Swift Testing Framework
Modern testing with Swift Testing framework. No XCTest.
Overview
Swift Testing replaces XCTest with a modern macro-based approach that's more concise, has better async support, and runs tests in parallel by default. The core principle: if you learned XCTest, unlearn it—Swift Testing works differently.
References
Core Concepts
Assertions
| Macro | Use Case |
|---|---|
#expect(expression) | Soft check — continues on failure. Use for most assertions. |
#require(expression) | Hard check — stops test on failure. Use for preconditions only. |
Optional Unwrapping
let user = try #require(await fetchUser(id: "123"))
#expect(user.id == "123")
Test Structure
import Testing
@testable import YourModule
Sponsors
Details
- Repository
- github.com/johnrogers/claude-swift-engineering
- Categories
- Testing & QA, Documentation, Mobile Development
- First seen
- Jun 3, 2026