Test Suite Generator
Both tools can read the source file and generate matching tests. Claude Code can also run the tests immediately and iterate on failures. Cursor previews the test file for review before saving.
Generate a comprehensive test suite for {{file_or_module_path}}. Testing framework: {{test_framework}} Current test coverage: {{current_coverage}} (or "none") Requirements: 1. **Unit tests** for every exported function/method: - Happy path with realistic data - Edge cases: empty inputs, nulls, boundary values, maximum sizes - Error cases: invalid inputs, network failures, timeout scenarios 2. **Integration tests** for interactions between components: - Mock external dependencies ({{external_deps}}) - Test the actual integration between internal modules 3. **Test organization**: - Group with describe blocks by function/feature - Each test name should read as a sentence: "should return empty array when no items match filter" - Setup/teardown in beforeEach/afterEach — no test interdependencies Additional: - Use {{assertion_style}} assertion style - Generate test fixtures as constants at the top of the file, not inline - Add a comment "// Edge case" before non-obvious test scenarios - Aim for >90% branch coverage Do NOT test implementation details — test behavior and outputs.
Variables to customize
Why this prompt works
Both tools can read the source file and generate matching tests. Claude Code can also run the tests immediately and iterate on failures. Cursor previews the test file for review before saving.
What you get when you save this prompt
Your workspace unlocks powerful tools to iterate and improve.
AI Optimization
One-click improvement with structure analysis and pattern suggestions.
Version History
Track every edit. Compare versions side-by-side with word-level diffs.
Folders & Tags
Organize your library with nested folders, tags, and drag-and-drop.
$ npm i -g @promptingbox/mcpUse Everywhere
Access prompts from Claude, Cursor, ChatGPT & more via MCP integration.
Your prompts, organized
Save, version, and access your best prompts across ChatGPT, Claude, Cursor, and more.