Prompt Library 💻 Coding & Dev Write a Complete Testing Suite
Any 💻 Coding & Dev Advanced

Write a Complete Testing Suite

Build a comprehensive test suite covering unit, integration, and end-to-end tests.
👁 5 views ⎘ 0 copies ♥ 0 likes

The Prompt

Write a complete testing suite for the following application:

Application type: [web app / API / library / CLI tool]
Language: [JavaScript / TypeScript / Python / PHP / other]
Framework: [specify]
Testing frameworks to use: [Jest / Vitest / PyTest / PHPUnit / Cypress / Playwright / other]
Code to test: [paste the code or describe the application]
Current test coverage: [none / partial / good but incomplete]
CI/CD integration needed: [yes / no]
Mocking approach: [describe any external services to mock]

Build the complete test suite:

TESTING STRATEGY:
- Testing pyramid recommendation for this codebase
- Coverage targets (unit / integration / e2e split)
- What to test vs what not to test
- Test naming conventions

UNIT TESTS:
For each key function or class:
- Happy path tests
- Edge cases and boundary values
- Error conditions
- Null/undefined/empty inputs
- Mock dependencies setup
- Full test file with describe/it blocks

INTEGRATION TESTS:
- Database integration tests
- API endpoint tests (request/response)
- Service interaction tests
- Test database setup and teardown
- Fixture and seed data approach

END-TO-END TESTS:
- Critical user journeys to test
- For each journey: full e2e test code
- Page object model setup
- Test data management
- Handling async operations

TEST UTILITIES:
- Test helper functions
- Factory functions for test data
- Custom matchers or assertions
- Shared mock implementations

CI/CD INTEGRATION:
- Pipeline configuration for test runs
- Test parallelisation setup
- Coverage reporting configuration
- Failing fast strategy

TEST MAINTENANCE:
- How to keep tests from becoming brittle
- When to delete tests
- Refactoring tests without losing coverage
- Documentation standards for tests

📝 Fill in the blanks

Replace these placeholders with your own content:

[web app / API / library / CLI tool]
[JavaScript / TypeScript / Python / PHP / other]
[specify]
[Jest / Vitest / PyTest / PHPUnit / Cypress / Playwright / other]
[paste the code or describe the application]
[none / partial / good but incomplete]
[yes / no]
[describe any external services to mock]

How to use this prompt

1
Copy the prompt

Click "Copy Prompt" above to copy the full prompt text to your clipboard.

2
Replace the placeholders

Swap out anything in [BRACKETS] with your specific details.

3
Paste into Any

Open your preferred AI assistant and paste the prompt to get started.