Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: should resolve .ts from .js alias #213

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/__tests__/data/match-path-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,4 +216,15 @@ export const tests: ReadonlyArray<OneTest> = [
expectedPath: join("/root", "mylib", "index.cjs"),
extensions: defaultExtensionsWhenRunningInTsNode,
},
{
name: "should resolve .ts from .js alias",
absoluteBaseUrl: "/root/",
paths: {
"@/*": ["src/*"],
},
existingFiles: [join("/root", "src", "foo.ts")],
requestedModule: "@/foo.js",
expectedPath: join("/root", "src", "foo.ts"),
Copy link
Contributor

@IgnusG IgnusG Jul 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will your resolution work if the path is selected as follows?

Suggested change
expectedPath: join("/root", "src", "foo.ts"),
expectedPath: join("/root", "src", "foo"),

If so #216 would address it as well - otherwise it does not.

extensions: defaultExtensionsWhenRunningInTsNode,
},
];