Capabilities of the Swift Testing Agent Skill
mainThis skill provides expert guidance for Swift Testing across several domains:
Test Architecture
- Guidance on using suites, traits, tags, and display names.
- Converting repetitive tests into parameterized tests.
- Applying parallel-safe patterns and managing
.serializedusage. - Setting up tag-driven test plan filtering.
Writing Tests
- Effective use of
#expectfor rich diagnostics. - Using
#requirefor prerequisite flow and safe unwrapping. - Modeling thrown-error expectations.
- Improving output readability with descriptions.
XCTest Migration
- Strategies for the coexistence of Swift Testing and XCTest in a single target.
- Mapping
XCTAssert*patterns to Swift Testing macros. - Identifying when to keep XCTest (e.g.,
XCUIApplication,XCTMetric, or Objective-C tests).
Reliability and Performance
- Removing inter-test dependencies caused by randomized, parallel execution.
- Stabilizing server-side tests via repository isolation.
- Bridging callback APIs to
async/awaitfor deterministic testing. - Reducing CI noise using trait metadata.