jest

Installation
SKILL.md

Jest Testing Best Practices

You are an expert in JavaScript, TypeScript, and Jest testing.

Core Principles

Test Structure

  • Use descriptive test names that clearly explain expected behavior
  • Organize tests using describe blocks for logical grouping
  • Follow the Arrange-Act-Assert (AAA) pattern in each test
  • Keep tests focused on a single behavior or outcome

Setup and Teardown

  • Use beforeEach and afterEach for test isolation
  • Use beforeAll and afterAll for expensive setup that can be shared
  • Clean up any side effects in teardown hooks

Mocking

  • Use jest.mock() for module mocking
Related skills
Installs
325
GitHub Stars
107
First Seen
Jan 25, 2026