testing-integration-test-scaffold

Generate cross-module integration test harnesses for Apple platform projects.

4|1|Updated Apr 2, 2026
One-click install
npx skills add https://github.com/AutisticAF/claude-code-apple-dev-plugin --skill testing-integration-test-scaffold
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing-integration-test-scaffold
Source: https://github.com/AutisticAF/claude-code-apple-dev-plugin/tree/main/skills/testing-integration-test-scaffold
Command: npx skills add https://github.com/AutisticAF/claude-code-apple-dev-plugin --skill testing-integration-test-scaffold

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Helps teams test multiple modules together without hitting real servers or databases by providing a repeatable integration test harness that covers networking, persistence, and business logic wiring. Eliminates brittle ad-hoc test setups and reduces flakiness caused by network or storage variability.

Core Features & Use Cases

  • URLProtocol-based mock server that intercepts URLSession requests and returns configurable responses for deterministic API behavior.
  • MockServer helpers to register JSON or raw responses and simulate errors and delays for resilience testing.
  • In-memory persistence support (SwiftData ModelContainer and MockUserDefaults) so tests run fast and isolated.
  • TestEnvironment wiring that composes session, container, defaults, API client, repository, and view model for full-stack tests.
  • Common use cases: verify API → Repository → ViewModel flows, cache fallback when offline, request header/auth verification, and end-to-end save flows.

Quick Start

Generate an integration test scaffold for a feature that uses a URLProtocol mock server, an in-memory SwiftData container, MockUserDefaults, and a TestEnvironment wired to run API→Repository→ViewModel tests.

Frequently Asked Questions about testing-integration-test-scaffold

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

FAQPage Schema
How do I test API to Repository to ViewModel flows in Swift without hitting real servers?

Isolate API to Repository to ViewModel flows using a URLProtocol-based mock server to intercept URLSession requests and in-memory SwiftData containers for persistence, ensuring deterministic integration tests without hitting real servers.

How does URLProtocol work for mocking URLSession requests in iOS integration tests?

URLProtocol works for mocking URLSession requests by intercepting network calls at the session level, allowing you to register configurable JSON responses, simulate errors, and capture request headers for deterministic verification in Swift integration tests.

Can I use an in-memory SwiftData ModelContainer for fast integration testing?

You can use an in-memory SwiftData ModelContainer for fast integration testing by replacing real database storage with memory-only persistence, allowing tests to run quickly and isolated without writing to disk or affecting stored data.

What's the best way to test cache fallback scenarios offline in Swift?

The best way to test cache fallback scenarios offline in Swift is composing a TestEnvironment with a MockServer and in-memory persistence, simulating network failures and verifying repository logic retrieves cached data correctly without live connectivity.

Does this integration test scaffold support watchOS and tvOS modules?

This integration test scaffold supports watchOS and tvOS modules by generating cross-module test harnesses that isolate networking, persistence, and business logic across Apple platform projects using URLProtocol mocks and in-memory SwiftData containers.

Why are my Swift integration tests flaky when testing networking and persistence together?

Swift integration tests become flaky due to network or storage variability, which you can eliminate by using a URLProtocol mock server for deterministic API responses and an in-memory SwiftData container to isolate persistence from disk variability.