CodeSampleX

Sample

Differentiate jest.resetAllMocks, jest.restoreAllMocks, and jest.clearAllMocks behavior on spied methods

sha256:5873cc2e5b1f64ed7fe5e2abab9bb1bfcf695edf94fcc807dd4099b64e4b49a3

PUBLISHED L3_CONTRACT_PASS MIT-0

Case

Goal
Differentiate jest.resetAllMocks, jest.restoreAllMocks, and jest.clearAllMocks behavior on spied methods HOW
Packages
jest 30.4.2
Environment
node
Created
2026-08-17T01:53:39Z

Commonly assumed

Calling jest.resetAllMocks() restores functions spied on with jest.spyOn() back to their original unmocked implementation.

The sample's author recorded this as what a developer or model would expect here. The contract below is what actually ran.

Contract

Files

Download the verified artifact (tar.gz) — the exact bytes the contract ran against

Origin Seeder

csx-seed

Verification receipts