-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Support loading ESM test files #2382
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
Merged
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
9e79ccf
fix: use dynamic import() to load esm modules
arlac77 c8c9b22
style: fix some xo styling issues
arlac77 6873e32
style: xo is happy now
arlac77 c886006
test: differentiate module loading asserts based on node version (13)
arlac77 bba6daf
test: use fully qualified imports (index.js) in esm fixtures
arlac77 bc7a7d6
style: add hints to make import '.../index.js' pass
arlac77 4103261
style: use optional catch binding
arlac77 d8fdba3
fix: force esm loading exceptions to be catched by load function
arlac77 4a5c3fb
debug: node@13/windows import error
arlac77 f327ca0
test: asume esm loading on node 13@win32 does not work for now
arlac77 db441ee
test: new wording for esm load tests
arlac77 b0fa2ba
Revert "fix: force esm loading exceptions to be catched by load funct…
arlac77 6946d74
fix: convert path to url when using import()
arlac77 531eb1e
style: make xo happy
f11ee1e
fix: wording on when node does not support import()
arlac77 d496118
fix: check for import() with well known module
arlac77 72fdd72
Merge branch 'master' of https://github.com/avajs/ava
arlac77 2579067
perf: move import() detection logic out of loop
08c14b6
fix: error message wording
arlac77 e7d33dd
Use .mjs extension for probe, update comments
novemberborn 530a7fc
No need to await the import (my bad)
novemberborn dc743f6
Tweak error message
novemberborn 3ad38d4
Rename userland esm package fixture
novemberborn 71457dd
Rename type=module ESM fixture
novemberborn 3cbc4e6
Lazily check for dynamic import support
novemberborn 52e11cc
Update ES module recipe
novemberborn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// Keep this file in place. | ||
// It is there to check that ESM dynamic import actually works in the current Node.js version. |
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
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
This file was deleted.
Oops, something went wrong.
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
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import test from '../../../index.js'; // eslint-disable-line import/no-useless-path-segments, unicorn/import-index, import/extensions | ||
|
||
test('pass', t => { | ||
t.pass(); | ||
}); |
File renamed without changes.
File renamed without changes.
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think
can make this loop faster.