Testing conventions for Swift/SwiftUI projects using Clean Architecture. Covers Swift Testing framework for unit/integration tests, XCUITest for UI and E2E tests, manual protocol-based mocking, async testing patterns, and test organization. Use when writing tests, reviewing test code, setting up test infrastructure, or discussing testing strategy in Swift projects.
The 'swift-testing-conventions' skill provides a comprehensive guide to testing conventions specifically tailored for Swift and SwiftUI projects using Clean Architecture. It addresses the complexities of unit, integration, UI, and end-to-end (E2E) testing while ensuring efficient organization and maintainable testing practices. This skill guides developers through testing with the Swift Testing framework, leveraging XCUITest for UI and E2E tests, manual protocol-based mocking, and asynchronous testing patterns, offering a robust solution to ensure code quality and reliability in Swift applications.
This skill is ideal for organizing and structuring tests in Swift projects. It provides conventions for unit, integration, UI, and E2E testing, as well as naming conventions, file organization, and specific testing patterns for Swift/SwiftUI apps with Clean Architecture.
Yes, this skill is based on the Swift Testing framework, which is closely integrated with XCTest. It supports various types of tests, including unit, integration, and UI tests using XCUITest.
This skill focuses on Swift and SwiftUI projects using the Swift Testing framework and XCUITest. While it primarily emphasizes these tools, its conventions and best practices can be adapted for other testing frameworks with similar functionality.
Tests should be organized into clear directories like 'domainTests' for domain-related tests and '{app}Tests' for application-specific tests. The organization is based on Clean Architecture principles, with separate directories for entities, use cases, view models, and UI tests.
The FIRST principles emphasize writing fast, independent, repeatable, self-validating, and timely tests. Unit tests should be fast (<100ms), have no shared state, and produce the same result every time. Tests should be written before production code and pass without manual inspection.
Quick Setup:
.claude/skills/Repository
benaor/claude-config