{"library":"jest-mock","type":"library","category":null,"description":"The `jest-mock` package is a fundamental component of the Jest testing framework, providing the core utilities for creating, controlling, and asserting on mock functions, spies, and module mocks. Currently stable at version 30.3.0, it's released as part of the broader Jest project, which is evolving towards more frequent major updates after a significant three-year cycle for Jest 30. This library enables developers to isolate units of code for testing by replacing dependencies with controlled, test-specific implementations. Its key differentiators include deep integration with the Jest runner, comprehensive APIs for various mocking scenarios (functions, objects, modules), automatic mock resets, and robust TypeScript definitions, all designed to facilitate predictable and efficient unit and integration testing.","language":"javascript","status":"active","version":"30.3.0","tags":["javascript","typescript"],"last_verified":"Wed May 27","install":[{"cmd":"npm install jest-mock","imports":["const mockFunction = jest.fn((arg: string) => `mocked: ${arg}`);","const spy = jest.spyOn(someObject, 'someMethod');","import type { MockedFunction } from 'jest-mock';\n// or\nimport type { MockedFunction } from '@jest/globals';","import { mocked } from 'jest-mock';\n// or\nimport { mocked } from '@jest/globals';\nconst data = mocked<ReturnType<typeof fetchApi>>(await fetchApi());"]},{"cmd":"yarn add jest-mock","imports":[]},{"cmd":"pnpm add jest-mock","imports":[]}],"homepage":"https://jestjs.io","github":"https://github.com/jestjs/jest","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/jest-mock","openapi_spec":null,"status_page":null,"smithery":null,"compatibility":{"summary":{"python_range":"18–22","success_rate":0,"avg_install_s":null,"avg_import_s":null,"wheel_type":null},"url":"https://checklist.day/v1/registry/jest-mock/compatibility"}}