JordanCoin/ios-skills-collection / skills/bocato--swift-testing
swift-testing
VerifiedExpert guidance on Swift Testing best practices, patterns, and implementation. Use when developers mention: (1) Swift Testing, @Test, #expect, #require, or @Suite, (2) "use Swift Testing" or "modern testing patterns", (3) test doubles, mocks, stubs, spies, or fixtures, (4) unit tests, integration tests, or snapshot tests, (5) migrating from XCTest to Swift Testing, (6) TDD, Arrange-Act-Assert, or F.I.R.S.T. principles, (7) parameterized tests or test organization.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 9.5 KB |
| references/_index.md | markdown | 2.7 KB |
| references/async-testing.md | markdown | 4.7 KB |
| references/dump-snapshot-testing.md | markdown | 6.2 KB |
| references/fixtures.md | markdown | 4.2 KB |
| references/integration-testing.md | markdown | 4.5 KB |
| references/migration-xctest.md | markdown | 5.5 KB |
| references/parameterized-tests.md | markdown | 4.0 KB |
| references/snapshot-testing.md | markdown | 4.3 KB |
| references/test-doubles.md | markdown | 6.0 KB |
| references/test-organization.md | markdown | 4.0 KB |
references/_index.md
View on GitHub# Reference Index
Quick navigation for Swift Testing topics.
## Framework Basics
| File | Description |
|------|-------------|
| `test-organization.md` | Suites, tags, traits, parallel execution |
| `parameterized-tests.md` | Testing multiple inputs efficiently |
| `async-testing.md` | Async patterns, confirmation, timeouts |
| `migration-xctest.md` | XCTest to Swift Testing migration |
## Test Infrastructure
| File | Description |
|------|-------------|
| `test-doubles.md` | Complete taxonomy: Dummy, Fake, Stub, Spy, SpyingStub, Mock |
| `fixtures.md` | Fixture patterns, placement, and best practices |
| `integration-testing.md` | Module interaction testing patterns |
| `snapshot-testing.md` | UI regression testing with SnapshotTesting |
| `dump-snapshot-testing.md` | Text-based snapshot testing for data structures |
## Quick Links by Problem
### "I need to..."
- **Start using Swift Testing** -> `test-organization.md`
- **Test multiple inputs** -> `parameterized-tests.md`
- **Test async code** -> `async-testing.md`
- **Migrate from XCTest** -> `migration-xctest.md`
- **Create test doubles** -> `test-doubles.md`
- **Create test data** -> `fixtures.md`
- **Test module interactions** -> `integration-testing.md`
- **Test UI for regressions** -> `snapshot-testing.md`
- **Snapshot data structures** -> `dump-snapshot-testing.md`
### "I'm having issues with..."
- **Flaky tests** -> Check `fixtures.md` (date handling), `async-testing.md` (timing)
- **Slow tests** -> Check `test-doubles.md` (proper mocking), `integration-testing.md` (pyramid)
- **Test organization** -> `test-organization.md` (suites, tags)
- **XCTest syntax errors** -> `migration-xctest.md`
- **Choosing test doubles** -> `test-doubles.md` (decision table)
### "I want to learn about..."
- **F.I.R.S.T. principles** -> Main SKILL.md
- **Test pyramid** -> Main SKILL.md, `integration-testing.md`
- **Arrange-Act-Assert** -> Main SKILL.md
- **Martin Fowler's test double taxonomy** -> `test-doubles.md`
## File Statistics
| File | Description | Key Topics |
|------|-------------|------------|
| `test-organization.md` | ~180 lines | Suites, tags, traits, setup/teardown |
| `parameterized-tests.md` | ~160 lines | Arguments, zip, Cartesian products |
| `async-testing.md` | ~200 lines | Async/await, confirmation, timeouts |
| `migration-xctest.md` | ~220 lines | XCTest -> Swift Testing mapping |
| `test-doubles.md` | ~220 lines | Dummy, Fake, Stub, Spy, SpyingStub, Mock |
| `fixtures.md` | ~140 lines | Placement, patterns, date handling |
| `integration-testing.md` | ~160 lines | In-memory implementations, workflows |
| `snapshot-testing.md` | ~180 lines | SnapshotTesting setup, devices, modes |
| `dump-snapshot-testing.md` | ~200 lines | Text snapshots, deterministic values, customDump |
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |