From 2a1a9fb06a79aabe7d0b70ee36c2ce0ee856f650 Mon Sep 17 00:00:00 2001
From: Sergei Zharinov <zharinov@users.noreply.github.com>
Date: Mon, 30 Sep 2024 06:17:39 -0300
Subject: [PATCH] test: Fix test file content load for mocked `fs-extra`
 (#31687)

---
 test/http-mock.ts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/http-mock.ts b/test/http-mock.ts
index 009d892eb9..deca15df2c 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
-- 
GitLab