diff --git a/packages/jest-util/src/tryRealpath.ts b/packages/jest-util/src/tryRealpath.ts index 0674c5e4cdf8..b5b1fcc68c2d 100644 --- a/packages/jest-util/src/tryRealpath.ts +++ b/packages/jest-util/src/tryRealpath.ts @@ -11,7 +11,7 @@ export default function tryRealpath(path: string): string { try { path = realpathSync.native(path); } catch (error: any) { - if (error.code !== 'ENOENT') { + if (error.code !== 'ENOENT' && error.code !== 'EISDIR') { throw error; } }