Bỏ qua tới nội dung
TakoAPI
Quay lại kỹ năng

fosmvvm-viewmodel-test-generator

bởi foscomputerservices

Git & GitHub
302Lượt tải do clawskills.sh công bố
0Lượt xem
0 lượt thíchĐăng nhập để thích kỹ năng này
—Chưa có đánh giá
Đánh giá của bạn

Tóm tắt

Generate ViewModel tests with codable round-trip, versioning stability, and multi-locale translation verification.

Mô tả

Kỹ năng này làm gì

Generates Swift test files for FOSMVVM ViewModels, covering codable round-trip encoding, versioning stability, and multi-locale translation verification. Works from conversation context to determine ViewModel structure and localization requirements. Produces test suites and YAML translation files.

A single expectFullViewModelTests() call replaces writing separate codable, versioning, and localization tests by hand.

Khi nào nên dùng

  • Adding test coverage to a newly created ViewModel
  • Verifying all localized strings have translations in every supported locale
  • Testing nested ViewModel hierarchies with parent and child types
  • Checking that @LocalizedSubs substitution produces the correct output strings
  • Catching versioning regressions when a ViewModel structure changes

Quy trình ví dụ

ĐẦU VÀO

User asks: generate tests for DashboardViewModel which has @LocalizedString pageTitle and emptyMessage

AGENT
  1. 1

    Identifies ViewModels and their @LocalizedString properties from conversation context

  2. 2

    Determines YAML entries needed for each locale (en, es by default)

  3. 3

    Generates DashboardViewModelTests.swift conforming to LocalizableTestCase with expectFullViewModelTests call

  4. 4

    Generates DashboardViewModel.yml with en and es translations for pageTitle and emptyMessage

  5. 5

    Reports file locations under Tests/{Target}Tests/Localization/ and Tests/{Target}Tests/TestYAML/

ĐẦU RA

DashboardViewModelTests.swift and DashboardViewModel.yml ready to drop into the SPM test target

Cài đặt

clawhub install foscomputerservices/fosmvvm-viewmodel-test-generator

Chạy lệnh CLI, hoặc dán prompt vào Claude Code, Cursor, Codex hay coding agent bạn đang dùng.

Liên kết