FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

test: verify dynamic import call with absolute path strings by legendecas · Pull Request #49275 · nodejs/node · GitHub

/ node Public

test: verify dynamic import call with absolute path strings - #49275

Merged
nodejs-github-bot merged 2 commits into
nodejs:mainfrom
legendecas:esm/import-absolute
Aug 31, 2023
Merged

test: verify dynamic import call with absolute path strings#49275
nodejs-github-bot merged 2 commits into
nodejs:mainfrom
legendecas:esm/import-absolute

Conversation

Copy link
Copy Markdown
Member

Add a test case that verifies that the dynamic import call can resolve absolute path strings without a scheme as the specifier.

Refs: #48655

nodejs-github-bot added esm Issues and PRs related to the ECMAScript Modules implementation. needs-ci PRs that need a full CI run. test Issues and PRs related to the tests. labels Aug 21, 2023

aduh95 commented Aug 21, 2023
edited
Loading

Copy link
Copy Markdown
Contributor

This will never pass on Windows, this test can only pass if absolutePath happens to match the corresponding origin relative URL (so a Unix path that does not involve any %, ?, nor #).

aduh95 commented Aug 21, 2023
edited
Loading

Copy link
Copy Markdown
Contributor

aduh95 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I missed the fact that the test is in a conditional that exclude Windows. Still I'm -1 to the added test, paths are not and never will be supported a referrer, it has to be a URL.

legendecas commented Aug 24, 2023
edited
Loading

Copy link
Copy Markdown
Member Author

This adds a test to verify a specifier can be a string with a leading slash. The referrer is still the URL of the current module.

The volume root may be referenced via /, //, or file:///.
https://nodejs.org/api/esm.html#file-urls

The document mentioned that the volume root may be referenced as / but I didn't find a test case to cover this usage (please correct me if I missed anything). I believe if this use case is legit, it should be tested even if it is not the recommended way to import an absolute path.

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
legendecas added the request-ci Add this label to start a Jenkins CI on a PR. label Aug 30, 2023
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 30, 2023

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

legendecas added the commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. label Aug 30, 2023

Copy link
Copy Markdown
Collaborator

aduh95 added the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 31, 2023
nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 31, 2023
nodejs-github-bot merged commit 04a3567 into nodejs:main Aug 31, 2023

Copy link
Copy Markdown
Collaborator

Landed in 04a3567

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. esm Issues and PRs related to the ECMAScript Modules implementation. needs-ci PRs that need a full CI run. test Issues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL