Skip to content

Commit

Permalink
fix: correctly resolve remapped directories
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Feb 15, 2022
1 parent ecab294 commit c8c6981
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions packages/jest-resolve/src/__tests__/resolve.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,20 @@ describe('findNodeModule', () => {
path.resolve(conditionsRoot, './node_modules/exports/nestedDefault.js'),
);
});

test('supports separate directory path', () => {
const result = Resolver.findNodeModule('exports/directory/file.js', {
basedir: conditionsRoot,
conditions: [],
});

expect(result).toEqual(
path.resolve(
conditionsRoot,
'./node_modules/exports/some-other-directory/file.js',
),
);
});
});
});

Expand Down

0 comments on commit c8c6981

Please sign in to comment.