Generate Tests
generate_testsGenerate complete, runnable test files from implementation code, covering happy paths and edge cases. Specify framework and scenarios to get tailored tests.
Instructions
Generate test code for a given implementation.
Produces a complete, runnable test file that covers happy paths and edge cases. Specify the testing framework and any particular scenarios you want covered.
IMPORTANT: Always review the returned tests before accepting them.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | The implementation code to generate tests for. | |
| language | Yes | Programming language of the implementation. | |
| framework | No | Testing framework to use (e.g. 'pytest', 'jest', 'go test', 'junit'). Leave empty for the language's default. | |
| max_tokens | No | Max tokens override. | |
| temperature | No | Temperature override. | |
| requirements | No | Specific scenarios, edge cases, or coverage requirements for the generated tests. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | No | The generated artefact (code, tests, documentation). None on failure. | |
| error | No | Human-readable error message. None on success. | |
| success | Yes | Whether the generation completed successfully. | |
| metadata | No | Auxiliary data: token usage, elapsed time, quality warnings, etc. |