Cursor Prompt: Generate Comprehensive Tests
When to Use This Prompt
Use this after building your core features. Testing gives confidence for refactoring and deployment.
The Prompt
Write comprehensive tests for this codebase: 1. Unit tests for all utility functions and hooks 2. Component tests for key UI components (render, interaction, edge cases) 3. API route tests for all endpoints (success, validation errors, auth failures) 4. Integration tests for critical user flows Use Vitest + React Testing Library. Follow these patterns: - Arrange-Act-Assert structure - Test both happy paths and error cases - Mock external dependencies (API calls, databases) - Use descriptive test names: 'should [expected behavior] when [condition]' Start with the most critical paths first.
What to Customize
Adjust the testing framework if you prefer Jest. Add specific test scenarios for your business logic.
Expected Output
Test files organized by feature/component. Expect 70-80% code coverage on the first pass.