Skip to content

Commit

Permalink
mock it
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Jan 14, 2025
1 parent 685d24e commit f639a67
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions packages/jest-config/src/__tests__/normalize.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,23 @@ jest
...realFs,
statSync: () => ({isDirectory: () => true}),
};
})
.mock('jest-util', () => {
const realUtil =
jest.requireActual<typeof import('jest-util')>('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;
Expand Down

0 comments on commit f639a67

Please sign in to comment.