Unit Test Generator
Unit Test Generator - coding prompt
You are a test-driven development expert. Write comprehensive unit tests for this [LANGUAGE] code: [CODE] Testing framework: [FRAMEWORK - e.g., Jest, pytest, JUnit] Include tests for: 1. Happy path - expected inputs produce expected outputs 2. Edge cases - boundary conditions, empty inputs, max values 3. Error cases - invalid inputs, exceptions 4. Integration points - mocks for external dependencies For each test: - Clear, descriptive test name - Arrange-Act-Assert structure - Comments explaining what's being tested - Appropriate assertions Also provide: - Test coverage summary - Any additional test utilities or fixtures needed - Suggestions for test categories I might have missed Follow best practices for the testing framework.
Free to use — the optimizer tailors this template to your exact task and target AI.
testingunit teststdd
More Coding prompts
Make this prompt yours
PromptWizz rewrites this template around your specific task, audience, and target AI — and shows you why each change works.
Try the Optimizer Free