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, 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 Te
Detected risks:
The swift-testing skill provides guidance for writing and migrating tests using the Swift Testing framework, the modern testing solution for Swift projects targeting Xcode 16+ and Swift 6+. It helps developers create new unit tests, convert existing XCTest-based tests, and apply Swift Testing best practices. The skill focuses on the framework's recommended patterns and boundaries, helping users understand when to use Swift Testing and when XCTest or XCUITest should still be retained for specialized scenarios such as UI testing, performance benchmarking, or snapshot testing.
Key capabilities include creating tests with @Test, organizing test suites with @Suite, using traits such as tags, disabled tests, conditional execution, bug references, and time limits, and writing assertions with #expect and #require. The skill also covers execution model considerations, including parallel test execution and serialized suites for shared external state. Additional topics referenced in the skill include confirmation patterns, known-issue handling, test attachments, exit testing, mocking approaches, async testing patterns, test organization, issue recording, cancellation handling, and migration guidance from XCTest to Swift Testing.
This skill is intended for Swift developers, QA engineers, and teams maintaining Swift codebases who need to write reliable tests or modernize existing test suites. Common use cases include creating new unit tests for Swift applications and libraries, reviewing assertion usage, converting XCTest assertions such as XCTUnwrap or XCTFail, evaluating framework compatibility, and determining appropriate boundaries between Swift Testing, XCTest, and XCUITest.
Use Swift Testing for new unit tests. XCTest should generally be retained for UI tests, performance benchmarks, and snapshot tests.
#expect records a failure but allows the test to continue, while #require records a failure and stops execution, making it appropriate when later assertions depend on a value being available.
No. Swift Testing runs tests in parallel by default, so tests should not depend on execution order or shared mutable state.
Use a serialized suite with @Suite(.serialized) when tests interact with shared external state and must not execute concurrently.
The skill specifies Swift Testing for Xcode 16+ and Swift 6+ environments.
Quick Setup:
.claude/skills/Repository
dpearson2699/swift-ios-skills