Swift testing

From HoangNguyen0403/agent-skills-standard · View interactive version

Swift testing is an AI agent skill from the GitHub repository HoangNguyen0403/agent-skills-standard. Write XCTest cases, async tests, and organized test suites in Swift. Use when writing XCTest cases, async tests, or organizing test suites in Swift.

How to use this skill

Skill file

Swift Testing Standards

**Priority: P0 (CRITICAL)**

Universal anti-slop rules (naming, identity fixtures, tautologies, mock echoing, bug-first lock, sleeps, shallow assertions,

coverage): anti-slop-rules.md. Only Swift deltas follow.

Core Rule Anchors

parsing or error mapping; ban tests of trivial getters.

pass-through mock echoing.

execution; warm resume is not cold relaunch.

Write XCTest Cases

See implementation examples for XCTest setup/teardown, async tests, and UI test patterns.

Test Async Code

wait(for: [exp], timeout: 1.0) or prefer await fulfillment(of: [exp], timeout: 2.0) with timeout $\le 2.0\text{s}$ to

avoid stalling CI.

Organize Test Suites

companion test files.

before answering, then assert granted and denied outcomes separately; addUIInterruptionMonitor handles interruptions but

proves nothing on its own, so remove it in teardown. View-tree labels do not prove VoiceOver audio announcements or device

focus order. Distinguish simulator runs from physical-device performance.

Anti-Patterns

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.