jest-testing-expert

Design and configure Jest test suites for TypeScript projects.

Updated Dec 5, 2025
One-click install
npx skills add https://github.com/botPhU/project-An-English-speaking-practice-platform-supported-by-AI --skill jest-testing-expert-botphu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: jest-testing-expert
Source: https://github.com/botPhU/project-An-English-speaking-practice-platform-supported-by-AI/tree/main/.agent/skills/jest-expert
Command: npx skills add https://github.com/botPhU/project-An-English-speaking-practice-platform-supported-by-AI --skill jest-testing-expert-botphu

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides expert guidance to design, configure, and maintain sophisticated Jest test suites, enabling teams to implement advanced mocking, snapshot testing, async patterns, and TypeScript integration to improve reliability and performance.

Core Features & Use Cases

  • Advanced configuration: In-depth Jest setups, environment choices, and module resolution for large projects.
  • Advanced mocking & snapshots: Strategies for mocks, spies, manual mocks, timer control, and snapshot maintenance.
  • TypeScript & async testing: TS integration with ts-jest, async patterns, and robust error handling.
  • Use Case: When scaling tests in a TypeScript project, migrating from another framework, or adopting performance-conscious testing strategies.

Quick Start

Start by configuring a Jest environment with ts-jest, setting up moduleNameMapping, and implementing a small set of example tests to illustrate advanced patterns.

Frequently Asked Questions about jest-testing-expert

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure Jest with TypeScript using ts-jest for a large project?

Configure Jest with TypeScript by setting up ts-jest, defining moduleNameMapper for module resolution, and selecting appropriate test environments to handle large project structures and ensure robust type checking.

What's the best way to handle async testing and timer mocks in Jest?

Handle async testing and timer mocks in Jest by applying advanced patterns for asynchronous operations, utilizing fake timers for time control, and implementing robust error handling to verify asynchronous code behavior accurately.

How do I maintain and manage snapshot testing in complex test suites?

Maintain snapshot testing by implementing strategies for manual mocks, controlling snapshots to prevent drift, and applying advanced configurations to ensure snapshot reliability across complex test suites.

Can I use Jest for performance-conscious testing and enforce coverage thresholds?

Yes, use Jest for performance-conscious testing by configuring coverage thresholds, optimizing module hoisting behavior, and applying advanced setup patterns to enforce strict code coverage and fast feedback loops.

Why does Jest hoisting behavior affect my mocking setup in TypeScript?

Jest hoisting behavior affects mocking because it automatically lifts mock declarations to the top of the file, requiring specific configuration patterns to ensure mocks initialize correctly before module imports in TypeScript.

Do I need custom matchers to improve error handling in my TypeScript Jest tests?

You need custom matchers to improve TypeScript Jest tests by extending the assertion library, providing more specific error handling outputs, and ensuring type-safe validations tailored to your project's logic.