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

add test script variants using --experimental-import-meta-resolve #179

Merged
merged 7 commits into from
Oct 19, 2022

Conversation

iambumblehead
Copy link
Owner

@iambumblehead iambumblehead commented Oct 18, 2022

for tests that run in node18 (tsm, node, jest, jest-ts, node-ts and source-map) run each tests twice,

  1. one time using --experimental-import-meta-resolve, to test esmock with import.meta.resolve,
  2. second time without --experimental-import-meta-resolve, to test esmock with resolvewithplus

changes added to support import.meta.resolve,

  • parent urls are converted to fileURL when they are passed to import.meta.resolve. eg, "/path/to/parent" is converted to 'file:///path/to/parent'
  • values returned by import.meta.resolve are decoded with decodeURI, so that white%20space and other encodings are removed (without decodeURI, tests fail)

@iambumblehead
Copy link
Owner Author

related #176 (comment)

@koshic please review and give any opinion you may have :)

@iambumblehead
Copy link
Owner Author

@aladdin-add @tripodsan please review, if you are available

Copy link
Collaborator

@aladdin-add aladdin-add left a comment

Choose a reason for hiding this comment

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

LGTM! 👍

src/esmockModule.js Outdated Show resolved Hide resolved
src/esmockModule.js Outdated Show resolved Hide resolved
src/esmockModule.js Show resolved Hide resolved
src/esmockModule.js Outdated Show resolved Hide resolved
@iambumblehead iambumblehead merged commit 4bcbb6f into master Oct 19, 2022
@iambumblehead iambumblehead deleted the use-meta.import.resolve-when-available branch October 19, 2022 18:24
This was referenced Oct 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants