Skip to content
/ jest Public
forked from jestjs/jest

Commit

Permalink
correct logic
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Feb 17, 2022
1 parent 6eec12a commit 0f23f26
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions packages/jest-resolve/src/defaultResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,13 @@ export default function defaultResolver(

const pathToResolve = getPathInModule(path, resolveOptions);

const result = isAbsolute(pathToResolve)
? pathToResolve
: resolveSync(pathToResolve, {
...resolveOptions,
packageFilter: createPackageFilter(pathToResolve, options),
});
const result =
pathToResolve === path
? resolveSync(pathToResolve, {
...resolveOptions,
packageFilter: createPackageFilter(pathToResolve, options),
})
: pathToResolve;

// Dereference symlinks to ensure we don't create a separate
// module instance depending on how it was referenced.
Expand Down

0 comments on commit 0f23f26

Please sign in to comment.