diff --git a/packages/jest-config/src/__tests__/normalize.test.ts b/packages/jest-config/src/__tests__/normalize.test.ts index 9e9cb86d8d5a..0300d94e27c2 100644 --- a/packages/jest-config/src/__tests__/normalize.test.ts +++ b/packages/jest-config/src/__tests__/normalize.test.ts @@ -26,6 +26,23 @@ jest ...realFs, statSync: () => ({isDirectory: () => true}), }; + }) + .mock('jest-util', () => { + const realUtil = + jest.requireActual('jest-util'); + + return { + ...realUtil, + requireOrImportModule: (filePath: string, interop = true) => { + const result = require(filePath); + + if (interop) { + return realUtil.interopRequireDefault(result).default; + } + + return result; + }, + }; }); let root: string;