scaffold_api_contract_test
Generate API contract test code for Playwright, Jest, Vitest, or MSW to validate an API endpoint against a Zod schema.
Instructions
Generate an API contract test or mock boilerplate for Playwright, Jest, Vitest, or MSW. Use to answer: how do I write a test that validates this API endpoint against this schema?
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| method | No | HTTP method | GET |
| base_url | No | Base URL of the API | http://localhost:3000 |
| endpoint | Yes | API endpoint path (e.g., /api/users) | |
| framework | No | Testing framework to generate code for | playwright |
| test_name | No | Name of the generated test | API Contract Validation |
| schema_code | Yes | Zod schema code for the response body |