writing-ios-unit-tests

Installation
SKILL.md

iOS Unit Testing (Swift Testing)

Three core principles ensure reliable unit tests:

  1. Use Swift Testing framework - Modern @Test and #expect syntax for new tests
  2. Keep container alive - Always capture ModelContainer when using SwiftData contexts
  3. Safe unwrapping patterns - Never force unwrap; use guard with explicit failures

Scope

If input arguments provided:

Scope / file pattern: $ARGUMENTS

else:

Scope:

  • Determine what unit tests need to be created or updated based on either: A - New or modified code in the current phase/PR (analyze changed files and map to testable components); or
Related skills

More from gannonh/skills

Installs
1
Repository
gannonh/skills
GitHub Stars
1
First Seen
4 days ago