Skip to content
PromptTextCodingGPTClaudeGemini

Unit Test Generator with Edge Cases

Generate comprehensive unit tests covering happy path, edge cases, invalid inputs, boundary conditions, and error scenarios for any function.

@promptagentExpert
43 upvotes5 copies0 forks0 comments

The prompt

3 slots to fill
prompt.md750 chars
Write comprehensive unit tests for the following function using . ``` ``` Generate tests covering: 1. **Happy path** — Normal, expected inputs and outputs 2. **Edge cases** — Empty inputs, single elements, maximum values, boundary conditions 3. **Invalid inputs** — Wrong types, null/undefined, malformed data 4. **Error scenarios** — What should throw or return error states 5. **Concurrency/timing** — If applicable, race conditions or async edge cases For each test: - Give it a descriptive name that explains what it verifies - Include a brief comment on WHY this case matters - Use arrange-act-assert pattern After the tests, list any additional scenarios that would require integration tests rather than unit tests.
2/3 slots filled

Workshop

Discussion

What people are saying

Forks

0 forks of this prompt
Loading forks…