diff --git a/packages/jest-leak-detector/src/__tests__/index.test.ts b/packages/jest-leak-detector/src/__tests__/index.test.ts index 62f9afcb2777..dd5a97dbf2bb 100644 --- a/packages/jest-leak-detector/src/__tests__/index.test.ts +++ b/packages/jest-leak-detector/src/__tests__/index.test.ts @@ -7,6 +7,11 @@ import LeakDetector from '../index'; +jest.mock('v8', () => ({ + ...(jest.requireActual('v8') as Record), + getHeapSnapshot: jest.fn(), +})); + const gc = globalThis.gc; // Some tests override the "gc" value. Let's make sure we roll it back to its