About
This skill provides a comprehensive library of implementation patterns for Jest mocking, enabling developers to effectively isolate code under test from external side effects. It covers a wide spectrum of testing scenarios, from basic function mocks using jest.fn() and module-level overrides with jest.mock() to advanced techniques like spying on existing objects, simulating timers, and implementing dependency injection. By leveraging these patterns, developers can create faster, more reliable, and deterministic test suites that handle external APIs, complex asynchronous logic, and time-dependent code with ease.