Skip to content

Commit

Permalink
correct top-dir module resolution for jest config
Browse files Browse the repository at this point in the history
  • Loading branch information
ChALkeR committed Jul 14, 2024
1 parent a21001e commit 7728dc2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7728dc2

Please sign in to comment.