ios-testing

Audit and migrate Apple platform tests across XCTest and Swift Testing.

1|Updated Jun 9, 2026
One-click install
npx skills add https://github.com/Emasoft/emasoft-complete-ios-app-authoring --skill ios-testing-emasoft
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ios-testing
Source: https://github.com/Emasoft/emasoft-complete-ios-app-authoring/tree/main/skills/ios-testing
Command: npx skills add https://github.com/Emasoft/emasoft-complete-ios-app-authoring --skill ios-testing-emasoft

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Writing reliable, maintainable tests for Apple platform apps is fraught with common pitfalls: flaky async tests, mixed assertion frameworks that silently pass or fail, missing error path coverage, and tests that don't actually run or pass before shipping. This Skill eliminates those issues by providing clear, actionable guidance for every stage of the Apple platform testing workflow.

Core Features & Use Cases

  • F.I.R.S.T-Compliant Test Design: Enforces fast, isolated, repeatable, self-validating, and thorough test principles to catch bugs early and avoid false confidence.
  • Framework Selection & Migration Guidance: Clear rules for when to use Swift Testing (new unit/integration tests) vs XCTest (UI, performance, legacy code), plus a step-by-step workflow for migrating existing XCTest suites to Swift Testing.
  • Anti-Pattern Detection & Audit Workflows: Pre-built checklists and grep scripts to identify critical testing mistakes (like wait(for:) in async tests or real network calls in unit tests), plus structured audit processes to measure test coverage and quality.
  • Use Case Example: A developer writing tests for an async SwiftUI ViewModel can use this Skill to avoid common mistakes like missing @MainActor annotations on test suites, mixing XCTAssert inside @Test functions, or forgetting to add cancellation tests for async methods.

Quick Start

Use the ios-testing skill to write a complete, F.I.R.S.T-compliant test suite for your async iOS ViewModel that covers success, failure, and cancellation paths, then run the suite locally to verify all tests pass before committing to your repository.

Frequently Asked Questions about ios-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write F.I.R.S.T-compliant tests for async iOS ViewModels?

F.I.R.S.T-compliant iOS testing enforces fast, isolated, repeatable, self-validating, and thorough principles. You achieve this by using correct Swift Testing or XCTest framework selection, adding @MainActor annotations, and covering success, failure, and cancellation paths for async ViewModels.

When should I use Swift Testing instead of XCTest for my iOS applications?

Use Swift Testing for new unit and integration tests, while XCTest remains necessary for UI, performance, snapshot, and legacy code testing. Selecting the correct framework prevents mixed assertion issues and ensures deterministic async test execution across Apple platforms.

What is the best way to migrate existing XCTest suites to Swift Testing?

Migrating XCTest suites to Swift Testing requires a step-by-step workflow that replaces XCTAssert assertions with @Test functions. This ensures test compatibility and eliminates anti-patterns like mixing XCTAssert inside Swift Testing functions during the transition.

How do I audit an iOS test suite for anti-patterns and missing coverage?

Auditing an iOS test suite involves running pre-built grep scripts and checklists to detect anti-patterns like real network calls in unit tests or wait(for:) in async tests. This structured audit process measures test coverage and identifies critical testing mistakes.

Why are my async XCUITest and unit tests failing intermittently?

Intermittent async test failures often stem from anti-patterns like using wait(for:) in async tests or missing cancellation tests. Enforcing deterministic async testing patterns and F.I.R.S.T principles eliminates flaky tests and false confidence.

Can I use Swift Testing for XCUITest and performance testing on macOS?

Swift Testing is designed for new unit and integration tests, not XCUITest or performance testing. You must use XCTest for UI, performance, and snapshot testing across Apple platforms including macOS, watchOS, and visionOS to maintain F.I.R.S.T compliance.