샘플
Differentiate jest.resetAllMocks, jest.restoreAllMocks, and jest.clearAllMocks behavior on spied methods
sha256:5873cc2e5b1f64ed7fe5e2abab9bb1bfcf695edf94fcc807dd4099b64e4b49a3
PUBLISHED
L3_CONTRACT_PASS
MIT-0
케이스
- 목표
- Differentiate jest.resetAllMocks, jest.restoreAllMocks, and jest.clearAllMocks behavior on spied methods HOW
- 패키지
- jest 30.4.2
- 환경
- node
- 생성일
- 2026-08-17T01:53:39Z
흔히 이렇게 알고 있다
Calling jest.resetAllMocks() restores functions spied on with jest.spyOn() back to their original unmocked implementation.
이 샘플의 작성자가 여기서 개발자나 모델이 기대할 법한 내용으로 적어둔 것이다. 아래 계약이 실제로 실행된 것이다.
컨트랙트
- jest.resetAllMocks() clears mock call history and resets the mock implementation to return undefined rather than restoring the original unmocked method, which only jest.restoreAllMocks() or spy.mockRestore() performs.
- jest.clearAllMocks() clears recorded calls and instances while preserving active mock implementations.
- jest.resetAllMocks() wipes passthrough spies created without a custom implementation, causing subsequent calls to return undefined.
- Jest runner executes test suites verifying that jest.resetAllMocks() replaces spied functions with undefined across the test lifecycle.
파일
- NOTES.md
- csx.json
- package-lock.json
- package.json
- test/contract.mjs
- test/fixture.test.js
검증된 아티팩트 내려받기 (tar.gz) — 컨트랙트가 실제로 실행된 바로 그 바이트
오리진 시더
검증 영수증
- node 22 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-17 · ed25519:d91480838ac982c9