swift-testing
Writes and migrates Swift Testing framework tests with @Test, @Suite, #expect, #require, confirmation, traits, withKnownIssue, Attachment.record, processExitsWith exit tests and capture lists, Test.cancel, Issue.record warnings/manual failures, XCTest-to-Swift Testing migration, Xcode 27 interoperability modes, XCUITest UI-test boundaries, performance/snapshot boundaries, mocking, async patterns, and test organization. Use when writing tests, converting XCTest assertions such as XCTUnwrap or XCTFail, reviewing advanced Swift Testing API availability, or deciding when to keep XCTest/XCUITest.
npx skills add dpearson2699/swift-ios-skills --skill swift-testing --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Swift Testing Swift Testing is the modern testing framework for Swift (Xcode 16+, Swift 6+). Prefer it for new unit tests. Keep XCTest where migration is still in progress, and use XCTest for UI automation, performance APIs, Objective-C exception tests, and common snapshot-test tooling. ## Contents - [Basic Tests](#basic-tests) - [`@Test Traits`](#test-traits) - [#expect and #require](#expect-and-require) - [`@Suite and Test Organization`](#suite-and-test-organization) - [Execution Model](#execution-model) - [XCTest Migration Boundaries](#xctest-migration-boundaries) - [Known Issues](#known-issues) - [Additional Patterns](#additional-patterns) - [Common Mistakes](#common-mistakes) - [Test Attachments](#test-attachments) - [Exit Testing](#exit-testing) - [Version-Gated APIs](#version-gated-apis) - [Review Checklist](#review-checklist) - [References](#references) --- ## Basic Tests ```swift import Testing @Test("User can update their display name") func updateDisplayName() { var user = User(name: "Alice") user.name = "Bob" #expect(user.name == "Bob") } ``` ## `@Test` Traits ```swift @Test("Validates email format") // display name @Test(.tags(.validation, .email)) // tags @Test(.dis
- Contents
- Basic Tests
- @Test Traits
- #expect and #require
- @Suite and Test Organization
- Execution Model
- XCTest Migration Boundaries
- Known Issues
- Additional Patterns
- Test Attachments
- Exit Testing
- Version-Gated APIs
- Common Mistakes
- Review Checklist
What does the swift-testing skill do?
Writes and migrates Swift Testing framework tests with @Test, @Suite, #expect, #require, confirmation, traits, withKnownIssue, Attachment.record, processExitsWith exit tests and capture lists, Test.cancel, Issue.record warnings/manual failures, XCTest-to-Swift Testing migration, Xcode 27 interoperability modes, XCUITest UI-test boundaries, performance/snapshot boundaries, mocking, async patterns, and test organization. Use when writing tests, converting XCTest assertions such as XCTUnwrap or XCTFail, reviewing advanced Swift Testing API availability, or deciding when to keep XCTest/XCUITest.
How do I install it?
Run `npx skills add dpearson2699/swift-ios-skills --skill swift-testing --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From dpearson2699/swift-ios-skills, a repository with 963 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.