node/test/es-module
Antoine du Hamel 09c02ed26b
esm: bypass CJS loader in default load under --default-type=module
This allows user to opt-out from using the monkey-patchable CJS loader,
even to load CJS modules.

PR-URL: https://github.com/nodejs/node/pull/50004
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
2023-11-14 09:18:00 +01:00
..
es-module.status Revert "test: set test-esm-loader-resolve-type as flaky" 2023-10-23 08:19:44 +02:00
test-cjs-esm-warn.js esm: clarify ERR_REQUIRE_ESM errors 2023-09-15 05:13:54 +00:00
test-cjs-legacyMainResolve-permission.js src,permission: add multiple allow-fs-* flags 2023-08-17 18:39:04 +00:00
test-cjs-legacyMainResolve.js src: do not pass user input to format string 2023-08-01 20:05:51 +00:00
test-cjs-prototype-pollution.js esm: protect ESM loader from prototype pollution 2022-10-27 20:09:07 +00:00
test-dynamic-import-script-lifetime.js module: use symbol in WeakMap to manage host defined options 2023-09-14 15:42:24 +00:00
test-esm-assert-strict.mjs
test-esm-assertionless-json-import.js esm: use import attributes instead of import assertions 2023-10-14 03:52:38 +00:00
test-esm-basic-imports.mjs esm: improve typings and code coverage 2022-03-14 16:30:26 +01:00
test-esm-child-process-fork-main.mjs child_process: queue pending messages 2021-12-30 05:59:49 -08:00
test-esm-cjs-builtins.js test: refactor ESM tests to improve performance 2022-07-29 10:42:55 +02:00
test-esm-cjs-exports.js src,test: fix typos 2022-08-03 23:48:09 +02:00
test-esm-cjs-load-error-note.mjs test: refactor ESM tests to improve performance 2022-07-29 10:42:55 +02:00
test-esm-cjs-main.js test: refactor ESM tests to improve performance 2022-07-29 10:42:55 +02:00
test-esm-cjs-named-error.mjs test: ensure never settling promises are detected 2023-11-11 20:37:42 +01:00
test-esm-custom-exports.mjs cli: add -C alias for --conditions flag 2021-05-25 15:13:36 +02:00
test-esm-cyclic-dynamic-import.mjs
test-esm-data-urls.js esm: use import attributes instead of import assertions 2023-10-14 03:52:38 +00:00
test-esm-default-type.mjs
test-esm-detect-ambiguous.mjs esm: do not give wrong hints when detecting file format 2023-10-24 09:41:06 +02:00
test-esm-dns-promises.mjs lib: remove ERR_INVALID_OPT_VALUE and ERR_INVALID_OPT_VALUE_ENCODING 2020-09-11 17:54:42 +03:00
test-esm-double-encoding.mjs
test-esm-dynamic-import-attribute.js esm: use import attributes instead of import assertions 2023-10-14 03:52:38 +00:00
test-esm-dynamic-import-attribute.mjs esm: use import attributes instead of import assertions 2023-10-14 03:52:38 +00:00
test-esm-dynamic-import-mutating-fs.js test,benchmark: use tmpdir.fileURL() 2023-08-21 16:42:03 +00:00
test-esm-dynamic-import-mutating-fs.mjs test,benchmark: use tmpdir.fileURL() 2023-08-21 16:42:03 +00:00
test-esm-dynamic-import.js vm: allow dynamic import with a referrer realm 2023-11-14 09:17:50 +01:00
test-esm-encoded-path-native.js test: refactor ESM tests to improve performance 2022-07-29 10:42:55 +02:00
test-esm-encoded-path.mjs lib: fix regular expression to detect / and \ 2021-10-21 14:55:00 +00:00
test-esm-error-cache.js
test-esm-example-loader.mjs esm: consolidate ESM loader hooks 2021-09-11 18:08:35 -07:00
test-esm-experimental-warnings.mjs esm: update loaders warning 2023-09-19 03:59:50 +00:00
test-esm-export-not-found.mjs test: refactor ESM tests to improve performance 2022-07-29 10:42:55 +02:00
test-esm-exports-deprecations.mjs module: exports & imports map invalid slash deprecation 2022-09-11 12:01:37 +02:00
test-esm-exports.mjs module: exports & imports map invalid slash deprecation 2022-09-11 12:01:37 +02:00
test-esm-extension-lookup-deprecation.mjs test: use tmpdir.resolve() 2023-08-21 16:41:53 +00:00
test-esm-extensionless-esm-and-wasm.mjs esm: unflag extensionless javascript and wasm in module scope 2023-10-03 12:31:21 +08:00
test-esm-forbidden-globals.mjs
test-esm-fs-promises.mjs
test-esm-import-assertion-warning.mjs esm: use import attributes instead of import assertions 2023-10-14 03:52:38 +00:00
test-esm-import-attributes-1.mjs esm: use import attributes instead of import assertions 2023-10-14 03:52:38 +00:00
test-esm-import-attributes-2.mjs esm: use import attributes instead of import assertions 2023-10-14 03:52:38 +00:00
test-esm-import-attributes-3.mjs esm: use import attributes instead of import assertions 2023-10-14 03:52:38 +00:00
test-esm-import-attributes-errors.js esm: rename error code related to import attributes 2023-10-23 08:19:34 +02:00
test-esm-import-attributes-errors.mjs esm: rename error code related to import attributes 2023-10-23 08:19:34 +02:00
test-esm-import-attributes-validation.js esm: rename error code related to import attributes 2023-10-23 08:19:34 +02:00
test-esm-import-flag.mjs module: execute --import sequentially 2023-11-14 09:17:50 +01:00
test-esm-import-json-named-export.mjs test: refactor ESM tests to improve performance 2022-07-29 10:42:55 +02:00
test-esm-import-meta-resolve.mjs esm: fix return type of import.meta.resolve 2023-09-20 10:09:15 +00:00
test-esm-import-meta.mjs esm: add import.meta.dirname and import.meta.filename 2023-11-14 09:17:49 +01:00
test-esm-imports-deprecations.mjs module: fix segment deprecation for imports field 2022-10-13 07:31:31 -07:00
test-esm-imports.mjs module: fix segment deprecation for imports field 2022-10-13 07:31:31 -07:00
test-esm-initialization.mjs test: fix es-module/test-esm-initialization 2023-07-29 09:51:10 +00:00
test-esm-invalid-data-urls.js lib: fix MIME overmatch in data URLs 2023-08-13 23:24:22 +02:00
test-esm-invalid-pjson.js test: adapt to new JSON SyntaxError messages 2022-10-11 07:27:56 +02:00
test-esm-json-cache.mjs esm: use import attributes instead of import assertions 2023-10-14 03:52:38 +00:00
test-esm-json.mjs esm: use import attributes instead of import assertions 2023-10-14 03:52:38 +00:00
test-esm-live-binding.mjs
test-esm-loader-cache-clearing.js
test-esm-loader-chaining.mjs esm: unflag Module.register and allow nested loader import() 2023-07-19 10:33:47 +00:00
test-esm-loader-custom-condition.mjs util: fix module prefixes during inspection 2020-12-12 20:58:01 +00:00
test-esm-loader-default-resolver.mjs esm: identify parent importing a url with invalid host 2023-09-23 05:41:26 +00:00
test-esm-loader-dependency.mjs
test-esm-loader-event-loop.mjs esm: misc test refactors 2023-02-18 14:26:36 +00:00
test-esm-loader-hooks.mjs esm: fix support for URL instances in register 2023-09-17 00:48:48 +00:00
test-esm-loader-http-imports.mjs esm: add --import flag 2022-07-31 04:08:02 +01:00
test-esm-loader-invalid-format.mjs
test-esm-loader-invalid-url.mjs esm: add chaining to loaders 2022-05-04 16:51:12 +01:00
test-esm-loader-mock.mjs esm: refactor mocking test 2023-09-05 01:13:40 +00:00
test-esm-loader-modulemap.js module: ensure successful import returns the same result 2023-07-26 20:34:20 +00:00
test-esm-loader-not-found.mjs test: refactor ESM tests to improve performance 2022-07-29 10:42:55 +02:00
test-esm-loader-programmatically.mjs esm: add initialize hook, integrate with register 2023-08-03 05:10:59 +00:00
test-esm-loader-resolve-type.mjs esm: refactor test-esm-loader-resolve-type 2023-09-06 22:30:09 +00:00
test-esm-loader-search.js esm: move hook execution to separate thread 2023-04-13 09:35:17 +02:00
test-esm-loader-spawn-promisified.mjs test: fix some assumptions in tests 2023-07-31 13:09:07 +00:00
test-esm-loader-stringify-text.mjs esm: consolidate ESM loader hooks 2021-09-11 18:08:35 -07:00
test-esm-loader-thenable.mjs test: refactor ESM tests to improve performance 2022-07-29 10:42:55 +02:00
test-esm-loader-with-syntax-error.mjs esm: move hook execution to separate thread 2023-04-13 09:35:17 +02:00
test-esm-loader.mjs esm: consolidate ESM loader hooks 2021-09-11 18:08:35 -07:00
test-esm-main-lookup.mjs esm: protect ERR_UNSUPPORTED_DIR_IMPORT against prototype pollution 2023-08-11 06:29:14 +00:00
test-esm-module-not-found-commonjs-hint.mjs test: refactor ESM tests to improve performance 2022-07-29 10:42:55 +02:00
test-esm-named-exports.js esm: refactor test-esm-named-exports 2023-09-06 22:30:08 +00:00
test-esm-named-exports.mjs esm: refactor test-esm-named-exports 2023-09-06 22:30:08 +00:00
test-esm-namespace.mjs
test-esm-no-addons.mjs src: add option to disable loading native addons 2021-09-10 10:54:39 -05:00
test-esm-non-js.mjs test: refactor ESM tests to improve performance 2022-07-29 10:42:55 +02:00
test-esm-nowarn-exports.mjs test: refactor ESM tests to improve performance 2022-07-29 10:42:55 +02:00
test-esm-path-posix.mjs path: add path/posix and path/win32 alias modules 2020-10-20 14:27:31 +00:00
test-esm-path-win32.mjs path: add path/posix and path/win32 alias modules 2020-10-20 14:27:31 +00:00
test-esm-pkgname.mjs lib: fix regular expression to detect / and \ 2021-10-21 14:55:00 +00:00
test-esm-preserve-symlinks-main.js test: refactor ESM tests to improve performance 2022-07-29 10:42:55 +02:00
test-esm-preserve-symlinks-not-found-plain.mjs
test-esm-preserve-symlinks-not-found.mjs
test-esm-preserve-symlinks.js
test-esm-process.mjs process: fix named report export 2022-02-23 18:37:55 +02:00
test-esm-prototype-pollution.mjs esm: protect ESM loader from prototype pollution 2022-10-27 20:09:07 +00:00
test-esm-recursive-cjs-dependencies.mjs esm: fix loading of CJS modules from ESM 2023-09-06 10:12:14 +00:00
test-esm-repl-imports.js test_runner: align behavior of it and test 2023-03-05 09:42:29 +02:00
test-esm-repl.js test: prepare for consistent comma-dangle lint rule 2021-04-01 23:14:29 -07:00
test-esm-require-cache.mjs
test-esm-resolve-type.mjs test: use tmpdir.resolve() 2023-08-21 16:41:53 +00:00
test-esm-scope-node-modules.mjs
test-esm-shared-loader-dep.mjs
test-esm-shebang.mjs
test-esm-snapshot.mjs
test-esm-symlink-main.js test: use tmpdir.resolve() 2023-08-21 16:41:53 +00:00
test-esm-symlink-type.js test: prepare for consistent comma-dangle lint rule 2021-04-01 23:14:29 -07:00
test-esm-symlink.js
test-esm-syntax-error.mjs test: refactor ESM tests to improve performance 2022-07-29 10:42:55 +02:00
test-esm-throw-undefined.mjs
test-esm-tla-unfinished.mjs test: refactor ESM tests to improve performance 2022-07-29 10:42:55 +02:00
test-esm-tla.mjs module: unflag Top-Level Await 2020-08-03 14:27:28 -04:00
test-esm-type-field-errors.js esm: --experimental-default-type flag to flip module defaults 2023-09-29 06:18:44 +00:00
test-esm-type-field.mjs esm: --experimental-default-type flag to flip module defaults 2023-09-29 06:18:44 +00:00
test-esm-type-flag-cli-entry.mjs esm: bypass CommonJS loader under --default-type 2023-10-05 17:57:32 +00:00
test-esm-type-flag-errors.mjs esm: bypass CJS loader in default load under --default-type=module 2023-11-14 09:18:00 +01:00
test-esm-type-flag-loose-files.mjs esm: --experimental-default-type flag to flip module defaults 2023-09-29 06:18:44 +00:00
test-esm-type-flag-package-scopes.mjs esm: unflag extensionless javascript and wasm in module scope 2023-10-03 12:31:21 +08:00
test-esm-type-flag-string-input.mjs esm: --experimental-default-type flag to flip module defaults 2023-09-29 06:18:44 +00:00
test-esm-type-main.mjs
test-esm-undefined-cjs-global-like-variables.js module: clarify CJS global-like variables not defined error message 2021-04-13 19:06:48 +02:00
test-esm-unknown-extension.js esm: unflag extensionless javascript and wasm in module scope 2023-10-03 12:31:21 +08:00
test-esm-url-extname.js esm: --experimental-default-type flag to flip module defaults 2023-09-29 06:18:44 +00:00
test-esm-util-types.mjs util: add util/types alias module 2020-10-21 01:26:34 +02:00
test-esm-virtual-json.mjs esm: use import attributes instead of import assertions 2023-10-14 03:52:38 +00:00
test-esm-wasm.mjs module: fix code injection through export names 2023-10-13 18:03:52 -03:00
test-esm-windows.js test: use tmpdir.resolve() 2023-08-21 16:41:53 +00:00
test-http-imports-cli.mjs test: refactor ESM tests to improve performance 2022-07-29 10:42:55 +02:00
test-http-imports.mjs module: add application/json in accept header when fetching json module 2023-11-14 09:17:48 +01:00
test-loaders-hidden-from-users.js src: implement natives binding without special casing 2023-06-09 15:32:55 +02:00
test-loaders-unknown-builtin-module.mjs esm: misc test refactors 2023-02-18 14:26:36 +00:00
test-loaders-workers-spawned.mjs test: deflake test-loaders-workers-spawned 2023-10-23 08:19:38 +02:00
test-vm-compile-function-leak.js test: use checkIfCollectable in vm leak tests 2023-09-18 23:00:53 +02:00
test-vm-compile-function-lineoffset.js lib: fix compileFunction throws range error for negative numbers 2023-10-06 14:33:46 +00:00
test-vm-contextified-script-leak.js test: deflake test-vm-contextified-script-leak 2023-09-23 03:46:22 +00:00
test-vm-source-text-module-leak.js test: use checkIfCollectable in vm leak tests 2023-09-18 23:00:53 +02:00
test-vm-synthetic-module-leak.js test: use checkIfCollectable in vm leak tests 2023-09-18 23:00:53 +02:00
test-wasm-memory-out-of-bound.js esm: --experimental-default-type flag to flip module defaults 2023-09-29 06:18:44 +00:00
test-wasm-simple.js esm: --experimental-default-type flag to flip module defaults 2023-09-29 06:18:44 +00:00
test-wasm-web-api.js esm: --experimental-default-type flag to flip module defaults 2023-09-29 06:18:44 +00:00
testcfg.py