This walks you through Swift Testing, Apple's macro-based replacement for XCTest. It covers the #expect/#require distinction (most checks should use #expect, not #require), async testing without the Task wrapper nonsense, and parameterized tests with zip to avoid accidental Cartesian products. The migration table from XCTest assertions is handy if you're converting existing tests. Biggest gotcha: tests run in parallel by default, so you'll need .serialized for anything touching shared state. Good reference if you're tired of XCTest's verbosity or finally moving a real codebase to the new framework.

skills.sh installs
209
GitHub stars
233
last updated
Aug 21, 2026

Install

$ npx -y skills add johnrogers/claude-swift-engineering --skill swift-testing --agent claude-code

Installs into .claude/skills of the current project.

Files

Swift Testing Framework

Modern testing with Swift Testing framework. No XCTest.

Overview

Swift Testing replaces XCTest with a modern macro-based approach that's more concise, has better async support, and runs tests in parallel by default. The core principle: if you learned XCTest, unlearn it—Swift Testing works differently.

References

Core Concepts

Assertions

MacroUse Case
#expect(expression)Soft check — continues on failure. Use for most assertions.
#require(expression)Hard check — stops test on failure. Use for preconditions only.

Optional Unwrapping

let user = try #require(await fetchUser(id: "123"))
#expect(user.id == "123")

Test Structure

import Testing
@testable import YourModule

Sponsors

Details

Repository
github.com/johnrogers/claude-swift-engineering
Categories
Testing & QA, Documentation, Mobile Development
First seen
Jun 3, 2026

More from johnrogers/claude-swift-engineering

All 10
1charleswiltgen avataraxiom-swift-testingcharleswiltgen/axiomUse when writing unit tests, adopting Swift Testing framework, making tests run faster without simulator, architecting code for testability, testing async code 208skills.sh installs
2microsoft avatarwinui-ui-testingmicrosoft/win-dev-skillsAutomated UI testing for WinUI 3 apps — generate a batch test script, run all tests in one pass, read results. Covers element assertions, interactions, value ch201skills.sh installs
3harperaa avatarsecurity-testing-verificationharperaa/secure-claude-skillsTest security features and verify implementation before deployment. Use this skill when you need to test CSRF protection, rate limiting, input validation, verif198skills.sh installs
4jwilger avatartddjwilger/agent-skillsUse this skill whenever the user wants to write code using TDD, test-driven development, or test-first methodology. Triggers on: "/tdd", "let's do TDD", "write 195skills.sh installs
5charleswiltgen avataraxiom-testing-asynccharleswiltgen/axiomUse when testing async code with Swift Testing. Covers confirmation for callbacks, @MainActor tests, async/await patterns, timeout control, XCTest migration, pa176skills.sh installs
6rysweet avataroutside-in-testingrysweet/amplihackDeprecated compatibility alias for qa-team. Use when existing recipes or agents still invoke outside-in-testing by name. Redirects future work to the qa-team sk134skills.sh installs