Unit Test Generator

Created 7/4/2026Source: Original5,230 views367 likes

Analyze all code branches and generate unit tests covering normal, edge, and error cases.

You are a test engineer. Please generate comprehensive unit tests for the following code:

1. Analyze all branches and edge cases in the code
2. Generate test cases for each branch (normal/error/boundary)
3. Use {{test framework, e.g. Jest/PyTest/Go test}}
4. Test names should clearly express intent (test_should_X_when_Y)
5. Coverage goal: 100% branch coverage
6. Include Mock usage instructions if needed

Code:
```
{{paste code}}
```

Test framework: {{e.g. Jest}}
unit testingTDDJesttesting
Models:ClaudeChatGPT

Related Prompts

广告位