Test Generation Prompt Templates

Ready-to-use prompts for generating tests with CoreStory + Cursor. Copy, paste, and customize for your needs.


Table of Contents


Quick Templates

Universal Template (Works for Almost Everything)

I'm working on CoreStory project {project-id}.

Generate tests for {feature/module/component}.

Requirements:
- {list your requirements}

Test types needed: {unit/integration/e2e}
Framework: {Jest/PyTest/JUnit/etc.}
Coverage goal: {90%/all acceptance criteria/edge cases}

Include edge cases and error scenarios.

Output to: ./tests/{module}/

5-Second Template (Minimal)

I'm working on CoreStory project {project-id}.

Generate {unit/integration/e2e} tests for {feature} using {framework}.
Cover {requirements}.

Output to: ./tests/

Comprehensive Template (Maximum Detail)

I'm working on CoreStory project {project-id}.

TARGET: {specific file/module/component}

GENERATE: Comprehensive test suite including:
- Unit tests for business logic
- Integration tests for dependencies
- E2E tests for user workflows
- Edge cases and boundary conditions
- Error scenarios

ACCEPTANCE CRITERIA:
1. {criterion 1}
2. {criterion 2}
3. {criterion 3}

TECHNICAL:
- Framework: {framework}
- Mocking: {what to mock}
- Test data: {fixtures/factories/inline}
- Patterns: {AAA/GWT/POM}

REQUIREMENTS:
- {additional requirement 1}
- {additional requirement 2}

Organize by: {feature/test type/acceptance criterion}

Output to: ./tests/{module}/
Run with: {npm test / pytest / etc.}