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

fosmvvm-serverrequest-test-generator

bởi foscomputerservices

DevOps & Cloud
441Lượt tải do clawskills.sh công bố
2Sao
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 ServerRequest tests using VaporTesting.

Mô tả

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

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.

Khi nào nên dùng

  • 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

Quy trình ví dụ

ĐẦU VÀO

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

AGENT
  1. 1

    Reads ServerRequest type from conversation context to identify query params and ResponseBody type

  2. 2

    Plans test scenarios: success path with valid ID, not-found path with invalid ID

  3. 3

    Generates IdeaRequestTests.swift with @Suite and two @Test functions

  4. 4

    Adds withTestApp helper that registers IdeaController and calls withApp

  5. 5

    Writes typed assertions on response.status and response.body using app.testing().test()

ĐẦU RA

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

Cài đặt

clawhub install foscomputerservices/fosmvvm-serverrequest-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