diff --git a/packages/jest/src/plugins/plugin.ts b/packages/jest/src/plugins/plugin.ts index 5245ddeb38ddf..fdcb33388be48 100644 --- a/packages/jest/src/plugins/plugin.ts +++ b/packages/jest/src/plugins/plugin.ts @@ -429,9 +429,11 @@ function resolveJestPath(projectRoot: string, workspaceRoot: string): string { return resolvedJestPaths[projectRoot]; } - return require.resolve('jest', { + resolvedJestPaths[projectRoot] = require.resolve('jest', { paths: [projectRoot, workspaceRoot, __dirname], }); + + return resolvedJestPaths[projectRoot]; } /**