-
Notifications
You must be signed in to change notification settings - Fork 30.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d434368
commit a235f08
Showing
3 changed files
with
21 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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 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,11 @@ | ||
// Flags: --experimental-modules --loader ./test/fixtures/es-module-loaders/loader-invalid-format.mjs | ||
import { expectsError, mustCall } from '../common'; | ||
import assert from 'assert'; | ||
|
||
import('../fixtures/es-modules/test-esm-ok.mjs') | ||
.then(assert.fail, expectsError({ | ||
code: 'ERR_INVALID_RETURN_PROPERTY_VALUE', | ||
message: 'Expected string to be returned for the "format" from the ' + | ||
'"loader resolve" function but got type undefined.' | ||
})) | ||
.then(mustCall()); |
This file contains 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,8 @@ | ||
export async function resolve(specifier, parentModuleURL, defaultResolve) { | ||
if (parentModuleURL && specifier === '../fixtures/es-modules/test-esm-ok.mjs') { | ||
return { | ||
url: 'file:///asdf' | ||
}; | ||
} | ||
return defaultResolve(specifier, parentModuleURL); | ||
} |