LaunchKit · 2026
Back to Skills

fosmvvm-serverrequest-test-generator

Generate ServerRequest tests using VaporTesting.

2
441 downloads
by @foscomputerservices

Setup & Installation

openclaw skills install @foscomputerservices/fosmvvm-serverrequest-test-generator

Or with the ClawHub CLI, for registry-managed skill folders outside a full OpenClaw workspace:

npx clawhub install fosmvvm-serverrequest-test-generator

What This Skill Does

Generates test files for ServerRequest types using VaporTesting infrastructure. Tests are built around typed request/response validation, covering Show, Create, Update, and Delete operations without manual URL construction or JSON encoding.

Using app.testing().test(request, locale:) instead of manual URL strings or URLSession keeps tests type-safe and path-derivation automatic.

When to use it

  • Testing a ShowRequest returns the correct ViewModel for a given ID
  • Verifying CreateRequest rejects empty input with a 400 status
  • Running the same request across English and Spanish locales
  • Confirming a DeleteRequest removes an entity and subsequent Show returns 404
  • Testing UpdateRequest reflects changed field values in the response body

Example Workflow

Here's how your AI assistant might use this skill in practice.

INPUT

User asks: generate tests for IdeaShowRequest covering success and not-found cases

AGENT
  1. 1Reads ServerRequest type from conversation context to identify query params and ResponseBody type
  2. 2Plans test scenarios: success path with valid ID, not-found path with invalid ID
  3. 3Generates IdeaRequestTests.swift with @Suite and two @Test functions
  4. 4Adds withTestApp helper that registers IdeaController and calls withApp
  5. 5Writes typed assertions on response.status and response.body using app.testing().test()
OUTPUT

Tests/WebServerTests/Requests/IdeaRequestTests.swift with showRequest_success and showRequest_notFound test methods