jest-mock-extended provides type safe mocking extensions for Jest, with helpers to mock interfaces and objects in a familiar Jest-like style. It adds a calledWith() API for argument specific expectations (including for objects and functions), supports deep mocks of nested properties and class instances, and includes a matcher API and utilities like mockClear and mockReset.
Project status
- Actively maintained based on recent updates, with the latest upstream push on 2026-04-20 and a follow-on package update (4.0.1) later that same day.
- Apparent update cadence is moderate, the source had a gap of about 10 months from 4.0.0 (2025-06-14) to 4.0.1 (2026-04-20), and no updates are shown after that date through 2026-08-12.
AI summary generated
Recent updates
4.0.1
Version 4.0.1 is a patch release focused on improving TypeScript 6 compatibility, fixing calledWith matching behavior for object literals, and restoring typing support for overloaded functions in mock proxy types. The release notes describe matching and typing fixes, plus expanded peer dependency ranges for TypeScript 6.
4.0.0
Release 4.0.0 updates the project to Jest 30. In addition to dependency bumps, the code changes significantly refactor the TypeScript typings around mocking and calledWith behavior to align with Jest 30 and jest-mock types.
Breaking3.0.7
Release 3.0.7 primarily bumps the dependency ts-essentials to a newer major version. The only other code change is a small modification to the test suite (removal of a console log). No documented API or type changes are mentioned in the release notes.
3.0.5
Release 3.0.5 is described as a fix for a performance issue related to deep mocks. The code changes match this intent by refactoring the TypeScript type definitions that power DeepMockProxy to reduce costly recursive type resolution.
3.0.4
Release 3.0.4 updates Jest and expands TypeScript peer dependency support to include TypeScript 5. The code diff also indicates runtime behavior changes around how calledWith expectations interact with fallback mock implementations, which are not mentioned in the release notes.
3.0.2
Release 3.0.2 includes a small set of changes referenced only by “Added PR #110” in the release notes. The code introduces a new fallback mechanism for mocks (intended to throw when a return value is not configured) and updates tests and README accordingly.
3.0.1
Release 3.0.1 updates calledWithFn handling to enable overriding behavior when the same arguments are registered multiple times. The implementation changes how internal calledWith registrations are ordered and adds a regression test covering the new precedence.
3.0.0
Release 3.0.0 focuses on fixing a performance issue related to deep mocking. To address it, the project introduces an option to control support for mocking function properties during deep mocks, and updates documentation and tests accordingly.
BreakingFeatures2.0.7
Release 2.0.7 is a TypeScript typing fix focused on deep mocks when a mocked member is both callable and also has nested properties. The change is verified by new unit tests covering multiple levels of deep mocking for function-with-props cases.
2.0.6
Release 2.0.6 is focused on adding compatibility with Jest 28. The only code diff shown is a package.json update to bump the package version and adjust Jest-related dependency ranges.
Features