Swift Unit Testing Skill
Installation
SKILL.md
Swift Unit Testing
Build deterministic tests around observable behavior. Prefer Swift Testing for new Swift unit and integration tests; choose XCTest only where it still provides the required runner or API.
Compatibility baseline
- Swift Testing requires Swift 6 / Xcode 16 or newer. It supports Apple platforms, Linux, and Windows.
- XCTest remains appropriate for
XCUIApplication,XCTMetric, Objective-C tests, and incremental maintenance of existing XCTest suites. - Swift Testing and XCTest can coexist in one test target. Do not mix
@Testmethods into anXCTestCasesubclass. - State the app's actual deployment targets and CI Xcode version before recommending availability-sensitive traits or APIs.
- Treat APIs first introduced after the installed SDK as future-cycle features and gate them explicitly.