| name | test-generator |
| description | Generate test cases for a function or module |
| arguments | [{"name":"target","description":"Function or module to generate tests for","required":true},{"name":"framework","description":"Test framework to use (jest, vitest, pytest, unittest)","required":false,"default":"jest"}] |
Test Generator Skill
Generate comprehensive test cases for the specified function or module.
Test Categories to Cover
- Happy path: Normal expected inputs produce expected outputs
- Edge cases: Empty inputs, maximum values, boundary conditions
- Error cases: Invalid inputs, missing parameters, type mismatches
- Integration: Interaction with dependencies (mock where needed)
Output Format
Generate a complete test file:
describe("[FunctionName]", () => {
it("should [expected behavior] when [condition]", () => {
});
it("should handle [edge case]", () => {
});
it("should throw when [error condition]", () => {
});
});
Guidelines
- Each test should test ONE behavior
- Use descriptive test names that explain the scenario
- Mock external dependencies, don't mock the function under test
- Minimum 5 tests per function