Swift Testing

Installation
SKILL.md

Swift Testing Standards

Priority: P0

Implementation Guidelines

XCTest Framework

  • Standard Naming: Prefix test methods with test (e.g., testUserLoginSuccessful).
  • Setup/Teardown: Use setUpWithError() and tearDownWithError() for environment management.
  • Assertions: Use specific assertions: XCTAssertEqual, XCTAssertNil, XCTAssertTrue, etc.

Async Testing

  • Async/Await: Mark test methods as async and use await directly inside them.
  • Expectations: Use XCTestExpectation for callback-based or delegate-based async logic.
  • Timeout: Always set reasonable timeouts for expectations to avoid hanging CI.

Test Organization

Related skills
Installs
GitHub Stars
488
First Seen