diff --git a/src/jest.config.js b/src/jest.config.js index fa9cef9..39e8b41 100644 --- a/src/jest.config.js +++ b/src/jest.config.js @@ -124,7 +124,7 @@ export async function installJestEnvironment(jestGlobals) { if (c.restoreMocks) beforeEach(() => jest.restoreAllMocks()) if (c.resetModules) beforeEach(() => jest.resetModules()) - const require = createRequire(config.rootDir) + const require = createRequire(path.resolve(config.rootDir, 'package.json')) if (Object.hasOwn(specialEnvironments, c.testEnvironment)) { specialEnvironments[c.testEnvironment](require, jestGlobals, c.testEnvironmentOptions)