diff --git a/test/http-mock.ts b/test/http-mock.ts index 009d892eb96c6d..deca15df2c8259 100644 --- a/test/http-mock.ts +++ b/test/http-mock.ts @@ -1,7 +1,6 @@ import type { Url } from 'node:url'; import { afterAll, afterEach, beforeAll } from '@jest/globals'; import { codeBlock } from 'common-tags'; -import fs from 'fs-extra'; // eslint-disable-next-line no-restricted-imports import nock from 'nock'; import { makeGraphqlSnapshot } from './graphql-snapshot'; @@ -124,6 +123,7 @@ function massageHttpMockStacktrace(err: Error): void { return; } + const fs: typeof import('fs-extra') = jest.requireActual('fs-extra'); const content = fs.readFileSync(state.testPath, { encoding: 'utf8' }); // Shrink the `testName` until we could locate it in the source file