Prompt LibraryEngineering

Unit Test Case Generator from Function Prompt

Generate edge-case unit tests from a function.

The prompt

Generate unit tests for the function below. Include:
- Happy path (typical input).
- Boundary values (empty, zero, max, negative if applicable).
- Null/undefined and type-coercion cases.
- One test that should FAIL if the function regresses (regression guard).
Use the test framework already in the repo. Name tests descriptively.

Function:
```
{{code}}
```
Framework: {{framework}}

Replace the {{fields}} with your own context and tighten the rules to match your domain.

Share this prompt