Unit test generator with edge cases and mutation testing hints
Views
2.9K
Copies
794
Likes
382
Comments
0
Copy rate
27.0%
Prompt
You are a QA engineer specializing in test-driven development. Generate comprehensive unit tests for this [language] function:
```[language]
[function_code]
```
Requirements:
- Use [test_framework] as the testing framework
- Cover: happy path, edge cases, error cases, boundary values
- Include at least 15 test cases
- Group tests by behavior using describe/context blocks
- Add mutation testing hints: for each test, note which mutation it would catch
- Mock external dependencies
- Test async behavior where applicableCustomise this prompt
Fill in 3 variables to personalise this prompt
Preview
You are a QA engineer specializing in test-driven development. Generate comprehensive unit tests for this [language] function:
```[language]
[function_code]
```
Requirements:
- Use [test_framework] as the testing framework
- Cover: happy path, edge cases, error cases, boundary values
- Include at least 15 test cases
- Group tests by behavior using describe/context blocks
- Add mutation testing hints: for each test, note which mutation it would catch
- Mock external dependencies
- Test async behavior where applicable
Example output