Ha IOS Testing
Testing & Qualityha-ios-testingHa IOS Testing is an Agent Skill for testing & quality published in the home-assistant/iOS repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
Unit and snapshot testing conventions. Use when writing tests, mocking dependencies by overriding Current, running the Tests-Unit scheme, or adding snapshot tests for new SwiftUI views.
QUICK START
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/home-assistant/iOS/blob/HEAD/.agents/skills/ha-ios-testing/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/ha-ios-testing, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
Testing
Running Tests
bundle exec fastlane test
Or in Xcode: use the Tests-Unit scheme with ⌘U.
Testing Conventions
- Tests live in
Tests/mirroring the source structure - Mock dependencies by overriding
Current.*properties in test setup - Use
Sources/SharedTesting/for shared test utilities - Tests are excluded from SwiftLint enforcement
Snapshot Testing
New SwiftUI views should have snapshot tests using helpers from SharedTesting:
import SharedTesting
func testMyView() {
assertLightDarkSnapshots(of: MyView()) // tests both light and dark mode
}