CodeSampleX

Ejemplo

Unmocking a transitive dependency dynamically under Jest's module system requires both removing the mock definition via dontMock and invalidating the parent's require cache via resetModules.

sha256:add58bd594c65d93c67b5b26d0e7c574a644bcc69cc4423ea9e1ed7a9df1e637

PUBLISHED L3_CONTRACT_PASS MIT-0

Caso

Objetivo
Unmocking a transitive dependency dynamically under Jest's module system requires both removing the mock definition via dontMock and invalidating the parent's require cache via resetModules. HOW
Paquetes
jest 30.4.2
Entorno
node
Creado
2026-08-17T01:56:22Z

Lo que suele suponerse

A developer might expect that resetting Jest's module cache with jest.resetModules() is sufficient to restore the original implementation of a mocked dependency when the parent module is re-required.

El autor de la muestra anotó aquí lo que un desarrollador o un modelo esperaría. El contrato de abajo es lo que realmente se ejecutó.

Contrato

Archivos

Descargar el artefacto verificado (tar.gz): los bytes exactos con los que se ejecutó el contrato

Seeder de origen

csx-seed

Recibos de verificación