スキル一覧に戻る
dboone323

swift-testing

by dboone323

1🍴 0📅 2026年1月22日
GitHubで見るManusで実行

SKILL.md


name: swift-testing description: > Expertise for writing XCTest tests for Swift/SwiftUI iOS and macOS apps in this project. Use when writing tests for HabitQuest, AvoidObstaclesGame, CodingReviewer, MomentumFinance, PlannerApp, or Shared-Kit. Follows project conventions and patterns.

Swift Testing Expert (Project-Specific)

Testing expertise tailored for the iOS/macOS apps in this monorepo.

Project Test Structure

ProjectName/
├── ProjectName/           # Source files
├── ProjectNameTests/      # Unit tests
└── ProjectNameUITests/    # UI tests (if applicable)

Test Conventions

File Naming

  • Test file: [SourceFile]Tests.swift
  • Example: GameScene.swiftGameSceneTests.swift

Test Function Naming

func test_[unit]_[scenario]_[expectedResult]()
// Example:
func test_scoreManager_addPoints_incrementsScore()

Standard Patterns

import XCTest
@testable import ProjectName

final class ComponentTests: XCTestCase {
    var sut: Component!  // System Under Test

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

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

    func test_method_condition_expectedResult() {
        // Arrange

        // Act

        // Assert
    }
}

Async Testing

func test_asyncMethod_succeeds() async throws {
    let result = try await sut.fetchData()
    XCTAssertNotNil(result)
}

Memory Safety

// Use [weak self] in closures
Task { [weak self] in
    guard let self else { return }
    await self.performWork()
}

Running Tests

# Via Xcode
Cmd+U  # Run all tests

# Via command line
xcodebuild test -scheme ProjectName -destination 'platform=iOS Simulator,name=iPhone 16'

スコア

総合スコア

60/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です