smithery/fotescodev

watchos-testing

watchOS and iOS testing expert for unit tests, UI tests, and test-driven development. Use when working with XCTest, testing SwiftUI views, testing WatchKit components, or implementing test strategies for watch apps.

Installation

$ npx skills add smithery/fotescodev --skill watchos-testing

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery/fotescodev.

npx skills add smithery/fotescodev

Browse all from smithery/fotescodev

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Skill metadata

Parsed from SKILL.md frontmatter.

Allowed toolsRead, Grep, Glob, Bash(xcodebuild:*), Bash(xcrun simctl:*)

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 1,951 B
  • docs SUMMARY.md 238 B

History

  1. First recorded snapshot · 0 installs

SKILL.md

watchOS Testing Expert

Instructions

When helping with watchOS/iOS testing:

  1. Analyze existing test coverage
  2. Identify untested code paths
  3. Generate comprehensive test cases
  4. Use XCTest and Swift Testing frameworks appropriately

watchOS-Specific Testing

Challenges

  • Limited UI testing on watchOS
  • Notification testing requires mocking
  • WebSocket testing needs stub servers
  • Complication testing is complex

Approaches

  • Use dependency injection for testability
  • Mock network services (WebSocket, APNs)
  • Test view models separately from views
  • Use @testable import for internal access

Test Patterns

Unit Test Template

import XCTest
@testable import ClaudeWatch

final class WatchServiceTests: XCTestCase {
    var sut: WatchService!

    override func setUp() {
        super.setUp()
        sut = WatchService()
    }

    override func tearDown() {
        sut = nil
        super.tearDown()
    }

    func testExample() {
        // Given
        // When
        // Then
        XCTAssertNotNil(sut)
    }
}

Async Test Pattern

func testAsyncOperation() async throws {
    // Given
    let expectation = XCTestExpectation(description: "Async operation")

    // When
    let result = try await sut.performAsyncAction()

    // Then
    XCTAssertTrue(result)
}

Best Practices

  • Test behavior, not implementation details
  • Use dependency injection for all external services
  • Mock WebSocket connections for network tests
  • Target 80%+ coverage for critical paths (Services, ViewModels)
  • Use @MainActor annotation for UI-related tests