coding•6 prompts
Test Writing Prompts
Good tests catch bugs before users do. These prompts help you write tests that give confidence without being brittle.
1. Unit Test Generation
Best: ClaudeWrite unit tests for this function: [paste function]. Cover: happy path, edge cases, error conditions, boundary values, and type edge cases. Use [Jest/pytest/etc.] syntax. Each test should be independent and clearly named.
Test behavior, not implementation. Tests should survive refactoring.
2. Integration Test
Best: ClaudeWrite an integration test for this flow: [describe flow]. Components involved: [list them]. The test should verify: correct component interaction, data flow between components, and error handling across boundaries.
Integration tests catch issues unit tests miss. Test the seams.
3. E2E Test Scenarios
Best: ClaudeCreate E2E test scenarios for [feature/page]. Include: critical user flows, edge cases users might encounter, cross-browser considerations, and performance thresholds. Write in [Playwright/Cypress/etc.] format.
E2E tests should cover what matters most to users. Don't test everything.
4. Test Data Factory
Best: ClaudeCreate a test data factory for [entity type]. Include: basic factory function, variations for different scenarios (valid, invalid, edge cases), and builder pattern for customization. Make it easy to create test data.
Good test data factories speed up test writing and reduce duplication.
5. Mock Implementation
Best: ClaudeCreate mocks for testing code that depends on: [external service/database/API]. The mock should: simulate realistic responses, allow configuring different scenarios, and track calls for assertions.
Mocks should be realistic enough to catch real issues.
6. TDD Walkthrough
Best: ClaudeHelp me build [feature] using TDD. First, write the failing test based on the requirement: [describe requirement]. Then I'll implement. Then we'll refactor. Guide me through the red-green-refactor cycle.
TDD forces clear thinking about requirements before implementation.
Try These Prompts with Multiple AIs
Get responses from Claude, ChatGPT, Gemini, and more—all at once. Compare which AI handles these prompts best.
Try Council Free