Prompt · Intermediate · 8 min
Write unit tests for a function
Generate a focused test suite for a function covering normal cases, edges and failures, in the project's test framework.
- Cursor
- GitHub Copilot
- Claude Code
- ChatGPT
- Any assistant
- coding
- testing
- drafting
Inside this prompt
- Generate a focused test suite for a function covering normal cases, edges and failures, in the project's test framework. Written for AI coding work: the context, steps and output format are fixed so results come back in the same shape every time.
- Fill in: {{code}}, {{framework}}, {{edges}}
- Variables
- 3
The full prompt opens with a membership that covers AI Coding Prompts.
Sign in if you already subscribe.
Sign in
