swift-testing

Reference guide for writing tests in Swift to catch bugs in iPhone and Mac apps.

Installation
Run `npx skills add "https://github.com/prisma-labs-dev/apple-skills" --skill "swift-testing"` to install this skill, then follow its SKILL.md instructions for my next request.

Paste this into Claude Code, Cursor, or any agent that can run commands.

SKILL.mdShow the author's original SKILL.md
---
name: swift-testing
user-invocable: true
description: "API reference: Swift Testing framework. @Test, @Suite, #expect, #require, traits, parameterized tests, migrating from XCTest."
context: fork
agent: Explore
---

# Swift Testing Reference

Apple's modern testing framework (`import Testing`) for iOS 26+.

## Downloaded Reference Files

| File | Content |
|------|---------|
| [testing-overview.md](testing-overview.md) | Full Testing framework index |
| [defining-tests.md](defining-tests.md) | Defining test functions with @Test |
| [organizing-tests.md](organizing-tests.md) | Organizing tests with @Suite |
| [expectations.md](expectations.md) | #expect, #require, confirmations |
| [parameterized-testing.md](parameterized-testing.md) | Parameterized test patterns |
| [traits.md](traits.md) | Test traits (tags, conditions, time limits) |
| [migrating-from-xctest.md](migrating-from-xctest.md) | Migration guide from XCTest |

## Fetching More Docs

1. Search this skill's local `.md` files first.
2. If the topic is not here, check the other installed Apple skills you have available by their names, descriptions, or `SKILL.md` frontmatter, then grep their local files. This is faster and uses less context than fetching new docs from the internet.
3. If no installed skill has the page, use the relevant documentation path from `testing-overview.md` with the `sosumi.ai` Markdown mirror. For example, `/documentation/testing/test` maps to `https://sosumi.ai/documentation/testing/test`.

Ships with 7 supporting files:

  • defining-tests.md
  • expectations.md
  • migrating-from-xctest.md
  • organizing-tests.md
  • parameterized-testing.md
  • testing-overview.md
  • traits.md

Mirrored from the author's public source. Install counts from the open skills registry.

The systems behind these skills get built for partners every week.

Partner with us