swift-testing

Installation
SKILL.md

Swift Testing

Apple's Swift Testing framework — the default test framework in Xcode 16+ and recommended through Xcode 26. @Test/@Suite types, #expect/#require macros, traits, parameterized tests, confirmation(), and the incremental XCTest migration. The full API reference — every macro form, trait, suite/setup pattern, async + error testing, the XCTest mapping tables, and what stays in XCTest — lives in references/guide.md. This file is the decision and discipline layer: read it first, open the guide for specifics.

Dials

Set these explicitly at the start; they change what "correct" means.

  1. FRAMEWORK — swift-testing (default for all new unit/integration tests) · xctest-still-needed (UI automation with XCUIApplication, or performance measure/XCTMetric — these have no Swift Testing equivalent and stay in XCTest).
  2. STYLE — flat-@Test (free @Test functions, no shared state) · @Suite (a type grouping tests, with per-test fixtures via stored properties and init/deinit).
  3. DATA — single (one set of inputs per test) · parameterized (@Test(arguments:) runs the test once per input, each reported and re-runnable on its own).

When to use

Writing or reviewing any unit or integration test for Swift code, or migrating an XCTest suite. Swift Testing and XCTest run in the same target — migrate file by file, don't rewrite wholesale. For the async/await and Sendable mechanics a test exercises, pair with swift-concurrency. Run the suite with xcodebuild test -scheme "<Scheme>" -destination 'platform=iOS Simulator,name=<device>'.

Core rules

Installs
1
GitHub Stars
1
First Seen
Jun 18, 2026
swift-testing — moritztucher/swift-agent-skills