搜索

PythonReactSEOPDF
OpenClaw

fosmvvm-viewmodel-test-generator

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

foscomputerservices0 来源安装数☆ 0 仓库 Stars

安装与使用

请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。

SkillHub CLI

skillhub install foscomputerservices/fosmvvm-viewmodel-test-generator

打开来源仓库,查看说明和兼容环境后,按来源提供的命令或步骤安装。

将来源链接提供给你的 Agent,让它先读取说明、核对依赖,并向你说明将执行的安装步骤。

查看来源 ↗使用指南

技能说明

FOSMVVM ViewModel Test Generator

Generate test files for ViewModels following FOSMVVM testing patterns.

Conceptual Foundation

For full architecture context, see FOSMVVMArchitecture.md | OpenClaw reference

ViewModel testing in FOSMVVM verifies three critical aspects:

  1. Codable round-trip - ViewModel encodes and decodes without data loss
  2. Versioning stability - Structure hasn't changed unexpectedly
  3. Multi-locale translations - All @LocalizedString properties have values in all supported locales

The LocalizableTestCase protocol provides infrastructure that tests all three in a single call.


When to Use This Skill

  • Creating tests for new ViewModels
  • Adding test coverage to existing ViewModels
  • Verifying localization completeness across locales
  • Testing ViewModels with embedded/nested child ViewModels
  • Verifying @LocalizedSubs substitution behavior

What This Skill Generates

File Location Purpose
{Name}ViewModelTests.swift Tests/{Target}Tests/Localization/ Test suite conforming to LocalizableTestCase
{Name}ViewModel.yml Tests/{Target}Tests/TestYAML/ YAML translations for test (if needed)

The Testing Pattern

Standard Pattern (Most Tests)

For most ViewModels, a single line provides complete coverage:

@Test func dashboardViewModel() throws {
    try expectFullViewModelTests(DashboardViewModel.self)
}

This verifies:

  • Codable encoding/decoding
  • Versioned ViewModel stability
  • Translations exist for all locales (en, es by default)

This is sufficient for the vast majority of ViewModel tests.

Extended Pattern (Specific Formatting Verification)

When testing specific formatting behavior (substitutions, compound strings), add locale-specific assertions:

@Test func greetingWithSubstitution() throws {
    try expectFu...

来源信息

Source
github
Repository
openclaw/skills
Path
skills/foscomputerservices/fosmvvm-viewmodel-test-generator
Version
—
Commit
2e0e4adccf2ec77d6d5fda02d4c97a06cdb652e7
分类来源
rules
状态
active
可见性
public

这些信息来自收录时的来源分析,可能滞后;使用前请核对最新来源文件。

来源内容

SKILL.md
# FOSMVVM ViewModel Test Generator

Generate test files for ViewModels following FOSMVVM testing patterns.

## Conceptual Foundation

> For full architecture context, see [FOSMVVMArchitecture.md](../../docs/FOSMVVMArchitecture.md#testing-support) | [OpenClaw reference]({baseDir}/references/FOSMVVMArchitecture.md)

ViewModel testing in FOSMVVM verifies three critical aspects:

1. **Codable round-trip** - ViewModel encodes and decodes without data loss
2. **Versioning stability** - Structure hasn't changed unexpectedly
3. **Multi-locale translations** - All `@LocalizedString` properties have values in all supported locales

The `LocalizableTestCase` protocol provides infrastructure that tests all three in a single call.

---

## When to Use This Skill

- Creating tests for new ViewModels
- Adding test coverage to existing ViewModels
- Verifying localization completeness across locales
- Testing ViewModels with embedded/nested child ViewModels
- Verifying `@LocalizedSubs` substitution behavior

## What This Skill Generates

| File | Location | Purpose |
|------|----------|---------|
| `{Name}ViewModelTests.swift` | `Tests/{Target}Tests/Localization/` | Test suite conforming to `LocalizableTestCase` |
| `{Name}ViewModel.yml` | `Tests/{Target}Tests/TestYAML/` | YAML translations for test (if needed) |

---

## The Testing Pattern

### Standard Pattern (Most Tests)

For most ViewModels, a single line provides complete coverage:

```swift
@Test func dashboardViewModel() throws {
    try expectFullViewModelTests(DashboardViewModel.self)
}
```

This verifies:
- Codable encoding/decoding
- Versioned ViewModel stability
- Translations exist for all locales (en, es by default)

**This is sufficient for the vast majority of ViewModel tests.**

### Extended Pattern (Specific Formatting Verification)

When testing specific formatting behavior (substitutions, compound strings), add locale-specific assertions:

```swift
@Test func greetingWithSubstitution() throws {
    try expectFu...

相关技能

OpenClaw

x402hub

capncoconut

Register, communicate, and earn on the x402hub AI agent marketplace. Use when an agent needs to register on x402hub, browse or claim bounties, submit deliverables, send messages to other agents via x402 Relay,...

OpenClaw

claw

capevace

Real-time event bus for AI agents. Publish, subscribe, and share live signals across a network of agents with Unix-style simplicity.

OpenClaw

captchas-openclaw

captchasco

OpenClaw integration guidance for CAPTCHAS Agent API, including OpenResponses tool schemas and plugin tool registration.