The prompt

Unit Test Generator guides the model through a defined task while preserving the source prompt's useful structure and constraints. Use it when planning, writing, reviewing, or debugging software and you want a response that is easier to evaluate and act on.

text prompt
You are a testing expert who writes thorough, maintainable unit tests. Generate unit tests for this code: ```{{language}} {{codeToTest}} ``` **CONTEXT:** - Testing framework: [E.G., JEST, PYTEST, JUNIT] - Mocking library: {{ifApplicable}} - Code coverage goal: [E.G., 80%] Create comprehensive tests covering: 1. **HAPPY PATH TESTS** - Normal, expected inputs - Verify correct output 2. **EDGE CASES** - Empty inputs - Boundary values - Null/undefined - Single element vs multiple 3. **ERROR CASES** - Invalid inputs - Verify errors are thrown correctly - Error message validation 4. **INTEGRATION POINTS** - Mock external dependencies - Test with mocked responses - Test error responses from dependencies For each test: - Descriptive test name (should read like documentation) - Arrange/Act/Assert structure - Comments explaining what's being tested - Expected vs actual assertions Also provide: - Test file structure recommendation - Setup/teardown requirements - Suggested test data fixtures

Tune the prompt, not the plumbing.

Every control comes from this prompt’s content schema. Changes stay in your browser and update instantly.

Customized prompt1057 characters
You are a testing expert who writes thorough, maintainable unit tests. Generate unit tests for this code: ```a specific language Paste the relevant source material and context here. ``` **CONTEXT:** - Testing framework: [E.G., JEST, PYTEST, JUNIT] - Mocking library: a specific if applicable - Code coverage goal: [E.G., 80%] Create comprehensive tests covering: 1. **HAPPY PATH TESTS** - Normal, expected inputs - Verify correct output 2. **EDGE CASES** - Empty inputs - Boundary values - Null/undefined - Single element vs multiple 3. **ERROR CASES** - Invalid inputs - Verify errors are thrown correctly - Error message validation 4. **INTEGRATION POINTS** - Mock external dependencies - Test with mocked responses - Test error responses from dependencies For each test: - Descriptive test name (should read like documentation) - Arrange/Act/Assert structure - Comments explaining what's being tested - Expected vs actual assertions Also provide: - Test file structure recommendation - Setup/teardown requirements - Suggested test data fixtures

Useful structure, room to move.

Unit Test Generator guides the model through a defined task while preserving the source prompt's useful structure and constraints. Use it when planning, writing, reviewing, or debugging software and you want a response that is easier to evaluate and act on.

The prompt establishes the job first, then supplies concrete decisions a model can act on. The variables preserve that structure while letting you change the subject, context, or output.