jest-testing-expert

Diagnose and resolve Jest testing framework configuration and execution issues.

Updated Apr 23, 2025
One-click install
npx skills add https://github.com/ripgraphics/authorsinfo --skill jest-testing-expert-ripgraphics
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: jest-testing-expert
Source: https://github.com/ripgraphics/authorsinfo/tree/main/.cursor/skills/jest-expert
Command: npx skills add https://github.com/ripgraphics/authorsinfo --skill jest-testing-expert-ripgraphics

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides expert guidance and solutions for complex challenges encountered when using the Jest testing framework, ensuring robust, efficient, and reliable test suites.

Core Features & Use Cases

  • Advanced Mocking: Master intricate mocking strategies for dependencies, timers, and modules.
  • TypeScript Integration: Resolve configuration and type-checking issues with Jest and TypeScript.
  • Performance Optimization: Identify and fix performance bottlenecks in test execution.
  • Use Case: Debug a failing Jest test suite that intermittently times out due to complex asynchronous operations and incorrect mocking.

Quick Start

Use the jest-testing-expert skill to help resolve a 'ReferenceError: window is not defined' error in my Jest tests.

Frequently Asked Questions about jest-testing-expert

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

FAQPage Schema
How do I mock modules and timers in Jest for complex asynchronous testing?

To mock modules and timers in Jest, utilize advanced mocking strategies for dependencies and asynchronous operations. This approach resolves intermittent timeout errors by ensuring controlled, predictable test execution environments for complex async patterns.

Why am I getting a 'ReferenceError: window is not defined' error in my Jest tests?

The 'ReferenceError: window is not defined' error occurs when test execution environments lack browser APIs. Resolve this by configuring the correct Jest test environment for your JavaScript modules, ensuring global objects are available during test execution.

How do I configure Jest and TypeScript integration to fix type-checking errors?

Configuring Jest and TypeScript integration resolves type-checking errors by addressing module resolution and configuration mismatches. Proper setup ensures TypeScript types are correctly evaluated during JavaScript test execution.

What is the best way to optimize Jest test suite performance for slow execution?

Optimizing Jest test suite performance involves identifying and fixing execution bottlenecks within your tests. Analyzing test execution patterns and adjusting configuration resolves slow performance and ensures reliable test suite completion.

How do I debug Jest snapshot testing failures and module resolution issues?

Debugging Jest snapshot testing failures and module resolution issues requires diagnostic questions and specific debugging commands. Analyzing configuration mismatches and execution environments isolates the root cause of failing snapshots.

Does this Jest testing approach support CI/CD integration for TypeScript projects?

Yes, this Jest testing approach supports CI/CD integration for TypeScript projects. It provides diagnostic commands and configuration guidance to ensure robust test execution across continuous integration and delivery pipelines.