Swift Testing
Swift Testing guidance for @Test, #expect, #require, XCTest migration, async tests, and parameterized tests.
- CCM score
- 47 of 100
- skills.sh installs
- 215
- GitHub stars
- 235
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers the core Swift Testing model:
#expectfor soft checks,#requirefor hard preconditions, and optional unwrapping - Includes an XCTest-to-Swift-Testing assertion conversion table plus error, async, parameterized, confirmation, and tag patterns
- Flags pitfalls such as accidental Cartesian products without
zip, shared-state leaks, and parallel test conflicts needing.serialized - Designed for developers writing new Swift tests or migrating existing XCTest suites to the Swift Testing framework
Install
$ npx -y skills add johnrogers/claude-swift-engineering --skill swift-testing -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
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
Details
- Repository
- github.com/johnrogers/claude-swift-engineering
- Categories
- Testing & QA, Mobile Apps
- First seen
- Jun 3, 2026
Questions
What does the swift-testing skill do?
The swift-testing skill guides an agent to write tests with the Swift Testing framework using @Test, #expect and #require. It also covers migrating from XCTest, implementing async tests, and parameterizing tests.
How do I install the swift-testing skill?
Run npx -y skills add johnrogers/claude-swift-engineering --skill swift-testing -y in your project. Once installed, the swift-testing skill lets your agent write Swift Testing suites that replace XCTest.
Where does swift-testing stand in the Testing & QA category?
swift-testing is listed in the Testing & QA category on Claude Marketplaces, next to tdd, migrate-to-shoehorn, test-driven-development, webapp-testing and break-ui. What sets it apart is its focus on Swift Testing specifically, including the XCTest-to-Swift-Testing assertion conversions.
Does swift-testing help with parallel or async Swift tests?
Yes, the swift-testing skill covers async test functions, confirmations for callbacks, and parameterized tests built with zip. It also warns about parallel test conflicts and shows when to use .serialized.
More from johnrogers/claude-swift-engineering
All 10Similar to Swift Testing
More Testing & QAaxiom-swift-testingcharleswiltgen/axiom208 installsSwift Testing guidance for writing, migrating, and speeding up unit tests without a simulator.
axiom-testingcharleswiltgen/axiom1.4K installsComprehensive testing router for Swift Testing, XCTest, async tests, and UI automation with failure triage.
ios-testingpproenca/dot-skills293 installsComprehensive iOS testing guide for Swift 6.2 clinic MVVM-C apps, covering 44 rules across eight categories.
testingmindrally/skills898 installsGeneral testing guidance covering isolation, data setup, coverage, and assertion clarity across frameworks and languages.
cmux-testingmanaflow-ai/cmux5.3K installsScoped cmux verification guide covering Swift Testing, test target wiring, and local versus CI evidence for changes.
vitest-testingexistential-birds/beagle473 installsStructured guide of Vitest patterns covering unit and integration tests, assertions, async handling, and mocking.