Description
Writes unit tests for a function including edge cases and failure modes. Names tests by behavior, not implementation.
Prompt
41 words
Write a thorough unit-test suite for the function below in {{framework}}. Cover happy path, edge cases, invalid inputs, and failure modes. Name each test by the behavior it asserts. Add a one-line comment per test explaining why it matters.
Function:
{{function}}How to use
Copy the prompt and paste it into your AI tool of choice. It works best with claude-sonnet-4. See more prompts in Coding for related workflows.
Reviews
Loading reviews