Skip to content

Commit

Permalink
test: Fix test file content load for mocked fs-extra (#31687)
Browse files Browse the repository at this point in the history
  • Loading branch information
zharinov authored Sep 30, 2024
1 parent baf4053 commit 2a1a9fb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/http-mock.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2a1a9fb

Please sign in to comment.