diff --git a/packages/jest-resolve/src/defaultResolver.ts b/packages/jest-resolve/src/defaultResolver.ts index 9eff3727dc4a..c15e608ca5d5 100644 --- a/packages/jest-resolve/src/defaultResolver.ts +++ b/packages/jest-resolve/src/defaultResolver.ts @@ -108,11 +108,11 @@ const defaultResolver: SyncResolver = (path, options) => { const pathToResolve = getPathInModule(path, resolveOptions); + // resolveSync dereferences symlinks to ensure we don't create a separate + // module instance depending on how it was referenced. const result = resolveSync(pathToResolve, resolveOptions); - // Dereference symlinks to ensure we don't create a separate - // module instance depending on how it was referenced. - return realpathSync(result); + return result; }; export default defaultResolver;