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.