Unit Test Generator Prompt
A prompt for generating focused unit tests from a function or module — the happy path, boundary cases and expected failures. It asks the model to infer the testing framework, name each case by intent, and mark any assertion that depends on an assumption, which keeps the tests reviewable in Copilot or Claude Code.
Make it yours
Prompt language: EnglishWorkflow
5 steps- Paste the code and pick a framework.
- Generate the tests.
- Review each test's intent and assumptions.
- Run the suite and fix failures.
- Add only the tests that add real coverage.
Negative prompt
Parameters to record
- framework
- infer from the project
- coverage
- happy path + boundaries + errors
- output
- tests + run instructions
- Variables
- 3 customizable fields
Limitations
- Generated tests can assert the wrong expected value.
- They may miss framework-specific setup.
- They are a starting point, not a proof of correctness.
Related templates
View all →Code Refactor Prompt
A prompt for requesting a safe, incremental refactor of a code snippet — rename, split and simplify without changing behavior. It asks the model to preserve the public interface, list the changes it made, and flag any risky edits, which makes review faster in GitHub Copilot or Cursor.
Blog Post Outline Prompt
A reusable outline prompt for long-form blog posts and articles. It forces a clear structure — hook, sections, examples and a takeaway — before any drafting, so the first draft has direction instead of rambling. Swap the topic, audience and angle variables, then use the outline as the skeleton for a Jasper or Copy.ai draft.
Copywriting Variant Prompt
A prompt for generating multiple distinct angles of the same marketing copy — headline, subhead and body — so you can A/B test instead of guessing. It separates the offer, audience and tone into variables, then asks for three clearly different variants rather than three rewrites of the same idea.