Jest Rules
Delightful JavaScript testing framework. Run unit and integration tests with snapshots, mocking, and code coverage.
3 rules
Coverage Threshold Requirements
Intermediate
Set and enforce meaningful Jest coverage thresholds — minimum percentages for statements, branches, functions, and lines with per-directory overrides.
globs: **/jest.config.*, **/package.json
coverage, thresholds, ci-cd, code-quality
View Rule
Mock Cleanup and Isolation Rules
Intermediate
Enforce proper mock cleanup between Jest tests — restoreAllMocks in afterEach, no mock leakage, and predictable test isolation for reliable parallel execution.
globs: **/*.test.ts, **/*.test.tsx, **/*.spec.ts, **/*.spec.tsx, **/jest.config.*
mock-cleanup, test-isolation, flaky-tests, afterEach
View Rule
Test File Structure Standards
Beginner
Enforce consistent Jest test file organization — AAA pattern, describe grouping, naming conventions, and file placement mirroring the source directory structure.
globs: **/*.test.ts, **/*.test.tsx, **/*.spec.ts, **/*.spec.tsx, **/__tests__/**
test-structure, naming-conventions, aaa-pattern, organization
View Rule