Write comprehensive unit tests for the following [LANGUAGE] code:
[PASTE CODE HERE]
Requirements:
- Use [TESTING FRAMEWORK] (e.g., Jest, pytest, JUnit)
- Cover all public methods/functions
- Include tests for: happy path, edge cases, error handling, boundary values
- Mock external dependencies
- Aim for >90% code coverage
- Use descriptive test names following "should [expected behavior] when [condition]" pattern
- Group tests logically with describe/context blocks
Write comprehensive unit tests for the following [LANGUAGE] code:
[PASTE CODE HERE]
Requirements:
- Use [TESTING FRAMEWORK] (e.g., Jest, pytest, JUnit)
- Cover all public methods/functions
- Include tests for: happy path, edge cases, error handling, boundary values
- Mock external dependencies
- Aim for >90% code coverage
- Use descriptive test names following "should [expected behavior] when [condition]" pattern
- Group tests logically with describe/context blocks
How to use this prompt
Copy the prompt above and paste it into ChatGPT, Claude, Gemini, or any AI assistant. Replace the bracketed placeholders with your specific details.
Leave a Review
Tried this prompt? Let us know how it worked — your reviews help other users find the best prompts.