Jest Testing Suite Template

Generate comprehensive Jest test suites with mocking, fixtures, and coverage configuration

6/11/2026
Prompt
Create a Jest testing setup for:

Project Type: {{PROJECT_TYPE}} (React/Node/Library)
Testing Scope: {{SCOPE}} (unit/integration/e2e)
Coverage Target: {{COVERAGE_TARGET}}%

Generate complete testing infrastructure:

1. **Jest Configuration (jest.config.js):**
   - Module mapping
   - Transform configuration
   - Coverage thresholds
   - Test environment setup
   - Global setup/teardown
   - Reporter configuration

2. **Test Utilities (test-utils/):**
   - Custom render functions
   - Mock factories
   - Test data builders
   - Assertion helpers

3. **Mock Setup (__mocks__/):**
   - Module mocks
   - API mocks
   - Browser API mocks
   - Third-party library mocks

4. **Fixtures (__fixtures__/):**
   - Sample data files
   - Response fixtures
   - Configuration fixtures

5. **Test Templates:**
   - Unit test structure
   - Integration test structure
   - Snapshot test patterns
   - Async test patterns

6. **Coverage Configuration:**
   - Coverage collection
   - Threshold enforcement
   - Report formats
   - Exclusion patterns

7. **CI Integration:**
   - Test scripts
   - Coverage upload
   - Parallel execution
   - Test splitting

8. **Best Practices:**
   - AAA pattern (Arrange, Act, Assert)
   - Test naming conventions
   - Isolation strategies
   - Cleanup patterns

Include examples for common testing scenarios.

Or press ⌘C to copy

Variables (3)

Replace these placeholders with your own content before using the prompt.

[{PROJECT_TYPE][{SCOPE][{COVERAGE_TARGET]

Ready to use?

Copy and paste into your favorite AI tool

Test this prompt live

Try it in our AI Playground with Claude

Open Playground

Explore more Coding prompts

Browse Coding

Command Palette

Search for a command to run...