New advertisers: 50% off your first month with code FIRSTMONTHSee slots

Swift Testing framework guide covering @Test, #expect, #require, traits, known issues, and XCTest migration boundaries.

skills.sh installs
4.6K
GitHub stars
1.3K
last updated
Aug 21, 2026
View on GitHub

What it does

  • Covers writing unit tests with @Test, @Suite, #expect, #require, traits, and withKnownIssue, plus XCTest-to-Swift Testing migration
  • Includes parallel execution rules, .serialized suite guidance, attachments, exit testing, and Xcode 27 interoperability modes
  • Enforces that tests set up their own state, and keeps UI, performance, and common snapshot tests on XCTest or XCUITest
  • Designed for Swift 6 projects writing new unit tests or migrating existing XCTest suites file by file

Install

$ npx -y skills add dpearson2699/swift-ios-skills --skill swift-testing -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

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

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

Details

Repository
github.com/dpearson2699/swift-ios-skills
Categories
Testing & QA, Mobile Apps
First seen
Apr 16, 2026

More from dpearson2699/swift-ios-skills

All 94

Similar to Swift Testing

More Testing & QA