Test Generation for Cursor
The @-mention gives Cursor the actual file content. Requiring it to check existing test patterns first ensures new tests match the project's style rather than generic defaults.
Generate tests for @{{file_to_test}}. Test framework: {{test_framework}} Test file location: {{test_file_path}} Requirements: - Look at existing tests in the project first (check {{test_directory}}) and match their patterns - Test the public exports only - Include these categories: * Happy path (normal inputs, expected outputs) * Edge cases (empty, null, boundary values) * Error cases (invalid input, network failures, timeouts) - Mock {{dependencies_to_mock}} using the project's existing mock patterns - Each test name should describe the scenario: "should [expected behavior] when [condition]" Do NOT test implementation details like private functions or internal state.
Variables to customize
Why this prompt works
The @-mention gives Cursor the actual file content. Requiring it to check existing test patterns first ensures new tests match the project's style rather than generic defaults.
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.