Skip to content
This repository has been archived by the owner on Oct 18, 2023. It is now read-only.

Commit

Permalink
fix: import extensionless dependency file (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
privatenumber authored Jun 17, 2022
1 parent fb4357e commit 79ba70d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/loaders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ export const resolve: resolve = async function (
} catch (error) {
if (
(error instanceof Error)
&& isPath
&& !recursiveCall
) {
if ((error as any).code === 'ERR_UNSUPPORTED_DIR_IMPORT') {
Expand Down
5 changes: 5 additions & 0 deletions tests/specs/typescript/dependencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ export default testSuite(async ({ describe }, node: NodeApis) => {
expect(nodeProcess.stdout).toBe(output);
});

test('Import extensionless', async () => {
const nodeProcess = await node.import('package-module/ts');
expect(nodeProcess.stdout).toBe(output);
});

test('Import', async () => {
const nodeProcess = await node.import('package-typescript-export');
expect(nodeProcess.stdout).toBe(output);
Expand Down

0 comments on commit 79ba70d

Please sign in to comment.