← ClaudeAtlas

swift-testinglisted

Write and migrate tests using the Swift Testing framework with @Test, @Suite, #expect, #require, confirmation, parameterized tests, test tags, traits, withKnownIssue, XCTest UI testing, XCUITest, test plan, mocking, test doubles, testable architecture, snapshot testing, async test patterns, test organization, and test-driven development in Swift. Use when writing or migrating tests with Swift Testing framework, implementing parameterized tests, working with test traits, converting XCTest to Swift Testing, or setting up test organization and mocking patterns.
dpearson2699/swift-ios-skills · ★ 640 · Testing & QA · score 81
Install: claude install-skill dpearson2699/swift-ios-skills
# Swift Testing Swift Testing is the modern testing framework for Swift (Xcode 16+, Swift 6+). Prefer it over XCTest for all new unit tests. Use XCTest only for UI tests, performance benchmarks, and snapshot tests. ## Contents - [Basic Tests](#basic-tests) - [@Test Traits](#test-traits) - [#expect and #require](#expect-and-require) - [@Suite and Test Organization](#suite-and-test-organization) - [Known Issues](#known-issues) - [Additional Patterns](#additional-patterns) - [Parameterized Tests In Depth](#parameterized-tests-in-depth) - [Tags and Suites In Depth](#tags-and-suites-in-depth) - [Async Testing Patterns](#async-testing-patterns) - [Traits In Depth](#traits-in-depth) - [Common Mistakes](#common-mistakes) - [Test Attachments](#test-attachments) - [Exit Testing](#exit-testing) - [Review Checklist](#review-checklist) - [References](#references) --- ## Basic Tests ```swift 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 ```swift @Test("Validates email format") // display name @Test(.tags(.validation, .email)) // tags @Test(.disabled("Server migration in progress")) // disabled @Test(.enabled(if: ProcessInfo.processInfo.environment["CI"] != nil)) // conditional @Test(.bug("https://github.com/org/repo/issues/42")) // bu