summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGeoffrey Booth <456802+GeoffreyBooth@users.noreply.github.com>2022-01-06 03:07:52 -0800
committerGitHub <noreply@github.com>2022-01-06 11:07:52 +0000
commit8dd0658e87272d7574abc5c803a10845182da382 (patch)
tree4a6299785247881501570445a173ea0482c41cb1 /test
parent0b4e9ae656e93e5f5351e8eaf609ed4ac81bcc7e (diff)
downloadnode-new-8dd0658e87272d7574abc5c803a10845182da382.tar.gz
esm: refactor esm tests out of test/message
PR-URL: https://github.com/nodejs/node/pull/41352 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/common/fixtures.js6
-rw-r--r--test/common/fixtures.mjs2
-rw-r--r--test/es-module/test-esm-export-not-found.mjs39
-rw-r--r--test/es-module/test-esm-import-json-named-export.mjs25
-rw-r--r--test/es-module/test-esm-loader-not-found.mjs27
-rw-r--r--test/es-module/test-esm-loader-obsolete-hooks.mjs30
-rw-r--r--test/es-module/test-esm-loader-with-syntax-error.mjs24
-rw-r--r--test/es-module/test-esm-module-not-found-commonjs-hint.mjs35
-rw-r--r--test/es-module/test-esm-syntax-error.mjs19
-rw-r--r--test/fixtures/es-module-loaders/syntax-error-import.mjs1
-rw-r--r--test/fixtures/es-modules/import-json-named-export.mjs2
-rw-r--r--test/fixtures/esm_loader_not_found_cjs_hint_bare.mjs5
-rw-r--r--test/fixtures/print-error-message.js1
-rw-r--r--test/message/esm_display_syntax_error_import.mjs6
-rw-r--r--test/message/esm_display_syntax_error_import.out12
-rw-r--r--test/message/esm_display_syntax_error_import_json_named_export.mjs4
-rw-r--r--test/message/esm_display_syntax_error_import_json_named_export.out12
-rw-r--r--test/message/esm_display_syntax_error_import_module.mjs2
-rw-r--r--test/message/esm_display_syntax_error_import_module.out12
-rw-r--r--test/message/esm_display_syntax_error_module.mjs2
-rw-r--r--test/message/esm_display_syntax_error_module.out9
-rw-r--r--test/message/esm_import_assertion_failed.mjs2
-rw-r--r--test/message/esm_import_assertion_failed.out18
-rw-r--r--test/message/esm_import_assertion_missing.mjs3
-rw-r--r--test/message/esm_import_assertion_missing.out19
-rw-r--r--test/message/esm_import_assertion_unsupported.mjs2
-rw-r--r--test/message/esm_import_assertion_unsupported.out19
-rw-r--r--test/message/esm_loader_not_found.mjs3
-rw-r--r--test/message/esm_loader_not_found.out20
-rw-r--r--test/message/esm_loader_not_found_cjs_hint_bare.js17
-rw-r--r--test/message/esm_loader_not_found_cjs_hint_bare.out18
-rw-r--r--test/message/esm_loader_not_found_cjs_hint_relative.mjs3
-rw-r--r--test/message/esm_loader_not_found_cjs_hint_relative.out22
-rw-r--r--test/message/esm_loader_syntax_error.mjs3
-rw-r--r--test/message/esm_loader_syntax_error.out12
-rw-r--r--test/message/test-esm-loader-obsolete-hooks.mjs4
-rw-r--r--test/message/test-esm-loader-obsolete-hooks.out11
37 files changed, 210 insertions, 241 deletions
diff --git a/test/common/fixtures.js b/test/common/fixtures.js
index e5e1d887df..3ee87e8b2d 100644
--- a/test/common/fixtures.js
+++ b/test/common/fixtures.js
@@ -2,6 +2,7 @@
const path = require('path');
const fs = require('fs');
+const { pathToFileURL } = require('url');
const fixturesDir = path.join(__dirname, '..', 'fixtures');
@@ -9,6 +10,10 @@ function fixturesPath(...args) {
return path.join(fixturesDir, ...args);
}
+function fixturesFileURL(...args) {
+ return pathToFileURL(fixturesPath(...args));
+}
+
function readFixtureSync(args, enc) {
if (Array.isArray(args))
return fs.readFileSync(fixturesPath(...args), enc);
@@ -26,6 +31,7 @@ function readFixtureKeys(enc, ...names) {
module.exports = {
fixturesDir,
path: fixturesPath,
+ fileURL: fixturesFileURL,
readSync: readFixtureSync,
readKey: readFixtureKey,
readKeys: readFixtureKeys,
diff --git a/test/common/fixtures.mjs b/test/common/fixtures.mjs
index 06564de6fa..d6f7f6c092 100644
--- a/test/common/fixtures.mjs
+++ b/test/common/fixtures.mjs
@@ -3,6 +3,7 @@ import fixtures from './fixtures.js';
const {
fixturesDir,
path,
+ fileURL,
readSync,
readKey,
} = fixtures;
@@ -10,6 +11,7 @@ const {
export {
fixturesDir,
path,
+ fileURL,
readSync,
readKey,
};
diff --git a/test/es-module/test-esm-export-not-found.mjs b/test/es-module/test-esm-export-not-found.mjs
new file mode 100644
index 0000000000..cdfe6df0fc
--- /dev/null
+++ b/test/es-module/test-esm-export-not-found.mjs
@@ -0,0 +1,39 @@
+import { mustCall } from '../common/index.mjs';
+import { path } from '../common/fixtures.mjs';
+import { match, notStrictEqual } from 'assert';
+import { spawn } from 'child_process';
+import { execPath } from 'process';
+
+const importStatement =
+ 'import { foo, notfound } from \'./module-named-exports.mjs\';';
+const importStatementMultiline = `import {
+ foo,
+ notfound
+} from './module-named-exports.mjs';
+`;
+
+[importStatement, importStatementMultiline].forEach((input) => {
+ const child = spawn(execPath, [
+ '--input-type=module',
+ '--eval',
+ input,
+ ], {
+ cwd: path('es-module-loaders'),
+ });
+
+ let stderr = '';
+ child.stderr.setEncoding('utf8');
+ child.stderr.on('data', (data) => {
+ stderr += data;
+ });
+ child.on('close', mustCall((code, _signal) => {
+ notStrictEqual(code, 0);
+
+ // SyntaxError: The requested module './module-named-exports.mjs'
+ // does not provide an export named 'notfound'
+ match(stderr, /SyntaxError:/);
+ // The quotes ensure that the path starts with ./ and not ../
+ match(stderr, /'\.\/module-named-exports\.mjs'/);
+ match(stderr, /notfound/);
+ }));
+});
diff --git a/test/es-module/test-esm-import-json-named-export.mjs b/test/es-module/test-esm-import-json-named-export.mjs
new file mode 100644
index 0000000000..f70b927329
--- /dev/null
+++ b/test/es-module/test-esm-import-json-named-export.mjs
@@ -0,0 +1,25 @@
+import { mustCall } from '../common/index.mjs';
+import { path } from '../common/fixtures.mjs';
+import { match, notStrictEqual } from 'assert';
+import { spawn } from 'child_process';
+import { execPath } from 'process';
+
+const child = spawn(execPath, [
+ '--experimental-json-modules',
+ path('es-modules', 'import-json-named-export.mjs'),
+]);
+
+let stderr = '';
+child.stderr.setEncoding('utf8');
+child.stderr.on('data', (data) => {
+ stderr += data;
+});
+child.on('close', mustCall((code, _signal) => {
+ notStrictEqual(code, 0);
+
+ // SyntaxError: The requested module '../experimental.json'
+ // does not provide an export named 'ofLife'
+ match(stderr, /SyntaxError:/);
+ match(stderr, /'\.\.\/experimental\.json'/);
+ match(stderr, /'ofLife'/);
+}));
diff --git a/test/es-module/test-esm-loader-not-found.mjs b/test/es-module/test-esm-loader-not-found.mjs
new file mode 100644
index 0000000000..275f0b0f1e
--- /dev/null
+++ b/test/es-module/test-esm-loader-not-found.mjs
@@ -0,0 +1,27 @@
+import { mustCall } from '../common/index.mjs';
+import { path } from '../common/fixtures.mjs';
+import { match, ok, notStrictEqual } from 'assert';
+import { spawn } from 'child_process';
+import { execPath } from 'process';
+
+const child = spawn(execPath, [
+ '--experimental-loader',
+ 'i-dont-exist',
+ path('print-error-message.js'),
+]);
+
+let stderr = '';
+child.stderr.setEncoding('utf8');
+child.stderr.on('data', (data) => {
+ stderr += data;
+});
+child.on('close', mustCall((code, _signal) => {
+ notStrictEqual(code, 0);
+
+ // Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'i-dont-exist'
+ // imported from
+ match(stderr, /ERR_MODULE_NOT_FOUND/);
+ match(stderr, /'i-dont-exist'/);
+
+ ok(!stderr.includes('Bad command or file name'));
+}));
diff --git a/test/es-module/test-esm-loader-obsolete-hooks.mjs b/test/es-module/test-esm-loader-obsolete-hooks.mjs
new file mode 100644
index 0000000000..eff4104fc2
--- /dev/null
+++ b/test/es-module/test-esm-loader-obsolete-hooks.mjs
@@ -0,0 +1,30 @@
+import { mustCall } from '../common/index.mjs';
+import { fileURL, path } from '../common/fixtures.mjs';
+import { match, notStrictEqual } from 'assert';
+import { spawn } from 'child_process';
+import { execPath } from 'process';
+
+const child = spawn(execPath, [
+ '--no-warnings',
+ '--throw-deprecation',
+ '--experimental-loader',
+ fileURL('es-module-loaders', 'hooks-obsolete.mjs').href,
+ path('print-error-message.js'),
+]);
+
+let stderr = '';
+child.stderr.setEncoding('utf8');
+child.stderr.on('data', (data) => {
+ stderr += data;
+});
+child.on('close', mustCall((code, _signal) => {
+ notStrictEqual(code, 0);
+
+ // DeprecationWarning: Obsolete loader hook(s) supplied and will be ignored:
+ // dynamicInstantiate, getFormat, getSource, transformSource
+ match(stderr, /DeprecationWarning:/);
+ match(stderr, /dynamicInstantiate/);
+ match(stderr, /getFormat/);
+ match(stderr, /getSource/);
+ match(stderr, /transformSource/);
+}));
diff --git a/test/es-module/test-esm-loader-with-syntax-error.mjs b/test/es-module/test-esm-loader-with-syntax-error.mjs
new file mode 100644
index 0000000000..d973e72975
--- /dev/null
+++ b/test/es-module/test-esm-loader-with-syntax-error.mjs
@@ -0,0 +1,24 @@
+import { mustCall } from '../common/index.mjs';
+import { fileURL, path } from '../common/fixtures.mjs';
+import { match, ok, notStrictEqual } from 'assert';
+import { spawn } from 'child_process';
+import { execPath } from 'process';
+
+const child = spawn(execPath, [
+ '--experimental-loader',
+ fileURL('es-module-loaders', 'syntax-error.mjs').href,
+ path('print-error-message.js'),
+]);
+
+let stderr = '';
+child.stderr.setEncoding('utf8');
+child.stderr.on('data', (data) => {
+ stderr += data;
+});
+child.on('close', mustCall((code, _signal) => {
+ notStrictEqual(code, 0);
+
+ match(stderr, /SyntaxError:/);
+
+ ok(!stderr.includes('Bad command or file name'));
+}));
diff --git a/test/es-module/test-esm-module-not-found-commonjs-hint.mjs b/test/es-module/test-esm-module-not-found-commonjs-hint.mjs
new file mode 100644
index 0000000000..58f70d0b68
--- /dev/null
+++ b/test/es-module/test-esm-module-not-found-commonjs-hint.mjs
@@ -0,0 +1,35 @@
+import { mustCall } from '../common/index.mjs';
+import { fixturesDir } from '../common/fixtures.mjs';
+import { match, notStrictEqual } from 'assert';
+import { spawn } from 'child_process';
+import { execPath } from 'process';
+
+[
+ {
+ input: 'import "./print-error-message"',
+ // Did you mean to import ../print-error-message.js?
+ expected: / \.\.\/print-error-message\.js\?/,
+ },
+ {
+ input: 'import obj from "some_module/obj"',
+ expected: / some_module\/obj\.js\?/,
+ },
+].forEach(({ input, expected }) => {
+ const child = spawn(execPath, [
+ '--input-type=module',
+ '--eval',
+ input,
+ ], {
+ cwd: fixturesDir,
+ });
+
+ let stderr = '';
+ child.stderr.setEncoding('utf8');
+ child.stderr.on('data', (data) => {
+ stderr += data;
+ });
+ child.on('close', mustCall((code, _signal) => {
+ notStrictEqual(code, 0);
+ match(stderr, expected);
+ }));
+});
diff --git a/test/es-module/test-esm-syntax-error.mjs b/test/es-module/test-esm-syntax-error.mjs
new file mode 100644
index 0000000000..a8c0191717
--- /dev/null
+++ b/test/es-module/test-esm-syntax-error.mjs
@@ -0,0 +1,19 @@
+import { mustCall } from '../common/index.mjs';
+import { path } from '../common/fixtures.mjs';
+import { match, notStrictEqual } from 'assert';
+import { spawn } from 'child_process';
+import { execPath } from 'process';
+
+const child = spawn(execPath, [
+ path('es-module-loaders', 'syntax-error.mjs'),
+]);
+
+let stderr = '';
+child.stderr.setEncoding('utf8');
+child.stderr.on('data', (data) => {
+ stderr += data;
+});
+child.on('close', mustCall((code, _signal) => {
+ notStrictEqual(code, 0);
+ match(stderr, /SyntaxError:/);
+}));
diff --git a/test/fixtures/es-module-loaders/syntax-error-import.mjs b/test/fixtures/es-module-loaders/syntax-error-import.mjs
deleted file mode 100644
index 3a6bc5effc..0000000000
--- a/test/fixtures/es-module-loaders/syntax-error-import.mjs
+++ /dev/null
@@ -1 +0,0 @@
-import { foo, notfound } from './module-named-exports.mjs';
diff --git a/test/fixtures/es-modules/import-json-named-export.mjs b/test/fixtures/es-modules/import-json-named-export.mjs
new file mode 100644
index 0000000000..f491e8c252
--- /dev/null
+++ b/test/fixtures/es-modules/import-json-named-export.mjs
@@ -0,0 +1,2 @@
+/* eslint-disable no-unused-vars */
+import { ofLife } from '../experimental.json' assert { type: 'json' };
diff --git a/test/fixtures/esm_loader_not_found_cjs_hint_bare.mjs b/test/fixtures/esm_loader_not_found_cjs_hint_bare.mjs
deleted file mode 100644
index 4eb5f190af..0000000000
--- a/test/fixtures/esm_loader_not_found_cjs_hint_bare.mjs
+++ /dev/null
@@ -1,5 +0,0 @@
-'use strict';
-
-import obj from 'some_module/obj';
-
-throw new Error('Should have errored');
diff --git a/test/fixtures/print-error-message.js b/test/fixtures/print-error-message.js
new file mode 100644
index 0000000000..0650bfbd52
--- /dev/null
+++ b/test/fixtures/print-error-message.js
@@ -0,0 +1 @@
+console.error('Bad command or file name');
diff --git a/test/message/esm_display_syntax_error_import.mjs b/test/message/esm_display_syntax_error_import.mjs
deleted file mode 100644
index 2173cb2b2e..0000000000
--- a/test/message/esm_display_syntax_error_import.mjs
+++ /dev/null
@@ -1,6 +0,0 @@
-/* eslint-disable no-unused-vars */
-import '../common/index.mjs';
-import {
- foo,
- notfound
-} from '../fixtures/es-module-loaders/module-named-exports.mjs';
diff --git a/test/message/esm_display_syntax_error_import.out b/test/message/esm_display_syntax_error_import.out
deleted file mode 100644
index babdcfc934..0000000000
--- a/test/message/esm_display_syntax_error_import.out
+++ /dev/null
@@ -1,12 +0,0 @@
-file:///*/test/message/esm_display_syntax_error_import.mjs:5
- notfound
- ^^^^^^^^
-SyntaxError: The requested module '../fixtures/es-module-loaders/module-named-exports.mjs' does not provide an export named 'notfound'
- at ModuleJob._instantiate (node:internal/modules/esm/module_job:*:*)
- at async ModuleJob.run (node:internal/modules/esm/module_job:*:*)
- at async Promise.all (index 0)
- at async ESMLoader.import (node:internal/modules/esm/loader:*:*)
- at async loadESM (node:internal/process/esm_loader:*:*)
- at async handleMainPromise (node:internal/modules/run_main:*:*)
-
-Node.js *
diff --git a/test/message/esm_display_syntax_error_import_json_named_export.mjs b/test/message/esm_display_syntax_error_import_json_named_export.mjs
deleted file mode 100644
index fc14340467..0000000000
--- a/test/message/esm_display_syntax_error_import_json_named_export.mjs
+++ /dev/null
@@ -1,4 +0,0 @@
-// Flags: --experimental-json-modules --no-warnings
-/* eslint-disable no-unused-vars */
-import '../common/index.mjs';
-import { ofLife } from '../fixtures/experimental.json' assert { type: 'json' };
diff --git a/test/message/esm_display_syntax_error_import_json_named_export.out b/test/message/esm_display_syntax_error_import_json_named_export.out
deleted file mode 100644
index d4636489f2..0000000000
--- a/test/message/esm_display_syntax_error_import_json_named_export.out
+++ /dev/null
@@ -1,12 +0,0 @@
-file:///*/test/message/esm_display_syntax_error_import_json_named_export.mjs:*
-import { ofLife } from '../fixtures/experimental.json' assert { type: 'json' };
- ^^^^^^
-SyntaxError: The requested module '../fixtures/experimental.json' does not provide an export named 'ofLife'
- at ModuleJob._instantiate (node:internal/modules/esm/module_job:*:*)
- at async ModuleJob.run (node:internal/modules/esm/module_job:*:*)
- at async Promise.all (index 0)
- at async ESMLoader.import (node:internal/modules/esm/loader:*:*)
- at async loadESM (node:internal/process/esm_loader:*:*)
- at async handleMainPromise (node:internal/modules/run_main:*:*)
-
-Node.js *
diff --git a/test/message/esm_display_syntax_error_import_module.mjs b/test/message/esm_display_syntax_error_import_module.mjs
deleted file mode 100644
index c0345c44fb..0000000000
--- a/test/message/esm_display_syntax_error_import_module.mjs
+++ /dev/null
@@ -1,2 +0,0 @@
-import '../common/index.mjs';
-import '../fixtures/es-module-loaders/syntax-error-import.mjs';
diff --git a/test/message/esm_display_syntax_error_import_module.out b/test/message/esm_display_syntax_error_import_module.out
deleted file mode 100644
index af95ab469f..0000000000
--- a/test/message/esm_display_syntax_error_import_module.out
+++ /dev/null
@@ -1,12 +0,0 @@
-file:///*/test/fixtures/es-module-loaders/syntax-error-import.mjs:1
-import { foo, notfound } from './module-named-exports.mjs';
- ^^^^^^^^
-SyntaxError: The requested module './module-named-exports.mjs' does not provide an export named 'notfound'
- at ModuleJob._instantiate (node:internal/modules/esm/module_job:*:*)
- at async ModuleJob.run (node:internal/modules/esm/module_job:*:*)
- at async Promise.all (index 0)
- at async ESMLoader.import (node:internal/modules/esm/loader:*:*)
- at async loadESM (node:internal/process/esm_loader:*:*)
- at async handleMainPromise (node:internal/modules/run_main:*:*)
-
-Node.js *
diff --git a/test/message/esm_display_syntax_error_module.mjs b/test/message/esm_display_syntax_error_module.mjs
deleted file mode 100644
index da40a4ead8..0000000000
--- a/test/message/esm_display_syntax_error_module.mjs
+++ /dev/null
@@ -1,2 +0,0 @@
-import '../common/index.mjs';
-import '../fixtures/es-module-loaders/syntax-error.mjs';
diff --git a/test/message/esm_display_syntax_error_module.out b/test/message/esm_display_syntax_error_module.out
deleted file mode 100644
index 622e85ec75..0000000000
--- a/test/message/esm_display_syntax_error_module.out
+++ /dev/null
@@ -1,9 +0,0 @@
-file:///*/test/fixtures/es-module-loaders/syntax-error.mjs:2
-await async () => 0;
-^^^^^^^^^^^^^
-
-SyntaxError: Malformed arrow function parameter list
- at ESMLoader.moduleStrategy (node:internal/modules/esm/translators:*:*)
- at ESMLoader.moduleProvider (node:internal/modules/esm/loader:*:*)
-
-Node.js *
diff --git a/test/message/esm_import_assertion_failed.mjs b/test/message/esm_import_assertion_failed.mjs
deleted file mode 100644
index 30ea65c3e3..0000000000
--- a/test/message/esm_import_assertion_failed.mjs
+++ /dev/null
@@ -1,2 +0,0 @@
-import '../common/index.mjs';
-import 'data:text/javascript,export{}' assert {type:'json'};
diff --git a/test/message/esm_import_assertion_failed.out b/test/message/esm_import_assertion_failed.out
deleted file mode 100644
index eed4256516..0000000000
--- a/test/message/esm_import_assertion_failed.out
+++ /dev/null
@@ -1,18 +0,0 @@
-node:internal/errors:*
- ErrorCaptureStackTrace(err);
- ^
-
-TypeError [ERR_IMPORT_ASSERTION_TYPE_FAILED]: Module "data:text/javascript,export{}" is not of type "json"
- at new NodeError (node:internal/errors:*:*)
- at handleInvalidType (node:internal/modules/esm/assert:*:*)
- at validateAssertions (node:internal/modules/esm/assert:*:*)
- at defaultLoad (node:internal/modules/esm/load:*:*)
- at ESMLoader.load (node:internal/modules/esm/loader:*:*)
- at ESMLoader.moduleProvider (node:internal/modules/esm/loader:*:*)
- at new ModuleJob (node:internal/modules/esm/module_job:*:*)
- at ESMLoader.#createModuleJob (node:internal/modules/esm/loader:*:*)
- at ESMLoader.getModuleJob (node:internal/modules/esm/loader:*:*)
- at async ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:*:*) {
- code: 'ERR_IMPORT_ASSERTION_TYPE_FAILED'
-}
-Node.js *
diff --git a/test/message/esm_import_assertion_missing.mjs b/test/message/esm_import_assertion_missing.mjs
deleted file mode 100644
index 0b402d9e7f..0000000000
--- a/test/message/esm_import_assertion_missing.mjs
+++ /dev/null
@@ -1,3 +0,0 @@
-// Flags: --experimental-json-modules
-import '../common/index.mjs';
-import 'data:application/json,{}';
diff --git a/test/message/esm_import_assertion_missing.out b/test/message/esm_import_assertion_missing.out
deleted file mode 100644
index a56ec12aee..0000000000
--- a/test/message/esm_import_assertion_missing.out
+++ /dev/null
@@ -1,19 +0,0 @@
-node:internal/errors:*
- ErrorCaptureStackTrace(err);
- ^
-
-TypeError [ERR_IMPORT_ASSERTION_TYPE_MISSING]: Module "data:application/json,{}" needs an import assertion of type "json"
- at new NodeError (node:internal/errors:*:*)
- at validateAssertions (node:internal/modules/esm/assert:*:*)
- at defaultLoad (node:internal/modules/esm/load:*:*)
- at ESMLoader.load (node:internal/modules/esm/loader:*:*)
- at ESMLoader.moduleProvider (node:internal/modules/esm/loader:*:*)
- at new ModuleJob (node:internal/modules/esm/module_job:*:*)
- at ESMLoader.#createModuleJob (node:internal/modules/esm/loader:*:*)
- at ESMLoader.getModuleJob (node:internal/modules/esm/loader:*:*)
- at async ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:*:*)
- at async Promise.all (index *) {
- code: 'ERR_IMPORT_ASSERTION_TYPE_MISSING'
-}
-
-Node.js *
diff --git a/test/message/esm_import_assertion_unsupported.mjs b/test/message/esm_import_assertion_unsupported.mjs
deleted file mode 100644
index 86e594ce02..0000000000
--- a/test/message/esm_import_assertion_unsupported.mjs
+++ /dev/null
@@ -1,2 +0,0 @@
-import '../common/index.mjs';
-import '../fixtures/empty.js' assert { type: 'unsupported' };
diff --git a/test/message/esm_import_assertion_unsupported.out b/test/message/esm_import_assertion_unsupported.out
deleted file mode 100644
index 0dc3657e43..0000000000
--- a/test/message/esm_import_assertion_unsupported.out
+++ /dev/null
@@ -1,19 +0,0 @@
-node:internal/errors:*
- ErrorCaptureStackTrace(err);
- ^
-
-TypeError [ERR_IMPORT_ASSERTION_TYPE_UNSUPPORTED]: Import assertion type "unsupported" is unsupported
- at new NodeError (node:internal/errors:*:*)
- at handleInvalidType (node:internal/modules/esm/assert:*:*)
- at validateAssertions (node:internal/modules/esm/assert:*:*)
- at defaultLoad (node:internal/modules/esm/load:*:*)
- at ESMLoader.load (node:internal/modules/esm/loader:*:*)
- at ESMLoader.moduleProvider (node:internal/modules/esm/loader:*:*)
- at new ModuleJob (node:internal/modules/esm/module_job:*:*)
- at ESMLoader.#createModuleJob (node:internal/modules/esm/loader:*:*)
- at ESMLoader.getModuleJob (node:internal/modules/esm/loader:*:*)
- at async ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:*:*) {
- code: 'ERR_IMPORT_ASSERTION_TYPE_UNSUPPORTED'
-}
-
-Node.js *
diff --git a/test/message/esm_loader_not_found.mjs b/test/message/esm_loader_not_found.mjs
deleted file mode 100644
index 2b47e5a03e..0000000000
--- a/test/message/esm_loader_not_found.mjs
+++ /dev/null
@@ -1,3 +0,0 @@
-// Flags: --experimental-loader i-dont-exist
-import '../common/index.mjs';
-console.log('This should not be printed');
diff --git a/test/message/esm_loader_not_found.out b/test/message/esm_loader_not_found.out
deleted file mode 100644
index 841e97d679..0000000000
--- a/test/message/esm_loader_not_found.out
+++ /dev/null
@@ -1,20 +0,0 @@
-(node:*) ExperimentalWarning: --experimental-loader is an experimental feature. This feature could change at any time
-(Use `* --trace-warnings ...` to show where the warning was created)
-node:internal/errors:*
- ErrorCaptureStackTrace(err);
- ^
-Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'i-dont-exist' imported from *
- at new NodeError (node:internal/errors:*:*)
- at packageResolve (node:internal/modules/esm/resolve:*:*)
- at moduleResolve (node:internal/modules/esm/resolve:*:*)
- at defaultResolve (node:internal/modules/esm/resolve:*:*)
- at ESMLoader.resolve (node:internal/modules/esm/loader:*:*)
- at ESMLoader.getModuleJob (node:internal/modules/esm/loader:*:*)
- at ESMLoader.import (node:internal/modules/esm/loader:*:*)
- at initializeLoader (node:internal/process/esm_loader:*:*)
- at loadESM (node:internal/process/esm_loader:*:*)
- at runMainESM (node:internal/modules/run_main:*:*) {
- code: 'ERR_MODULE_NOT_FOUND'
-}
-
-Node.js *
diff --git a/test/message/esm_loader_not_found_cjs_hint_bare.js b/test/message/esm_loader_not_found_cjs_hint_bare.js
deleted file mode 100644
index 437fa2d3d4..0000000000
--- a/test/message/esm_loader_not_found_cjs_hint_bare.js
+++ /dev/null
@@ -1,17 +0,0 @@
-'use strict';
-
-require('../common');
-const { spawn } = require('child_process');
-const { join } = require('path');
-const { fixturesDir } = require('../common/fixtures');
-
-spawn(
- process.execPath,
- [
- join(fixturesDir, 'esm_loader_not_found_cjs_hint_bare.mjs'),
- ],
- {
- cwd: fixturesDir,
- stdio: 'inherit'
- }
-);
diff --git a/test/message/esm_loader_not_found_cjs_hint_bare.out b/test/message/esm_loader_not_found_cjs_hint_bare.out
deleted file mode 100644
index eaa758742f..0000000000
--- a/test/message/esm_loader_not_found_cjs_hint_bare.out
+++ /dev/null
@@ -1,18 +0,0 @@
-node:internal/process/esm_loader:*
- internalBinding('errors').triggerUncaughtException(
- ^
-
-Error [ERR_MODULE_NOT_FOUND]: Cannot find module '*test*fixtures*node_modules*some_module*obj' imported from *test*fixtures*esm_loader_not_found_cjs_hint_bare.mjs
-Did you mean to import some_module/obj.js?
- at new NodeError (node:internal/errors:*:*)
- at finalizeResolution (node:internal/modules/esm/resolve:*:*)
- at moduleResolve (node:internal/modules/esm/resolve:*:*)
- at defaultResolve (node:internal/modules/esm/resolve:*:*)
- at ESMLoader.resolve (node:internal/modules/esm/loader:*:*)
- at ESMLoader.getModuleJob (node:internal/modules/esm/loader:*:*)
- at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:*:*)
- at link (node:internal/modules/esm/module_job:*:*) {
- code: 'ERR_MODULE_NOT_FOUND'
-}
-
-Node.js *
diff --git a/test/message/esm_loader_not_found_cjs_hint_relative.mjs b/test/message/esm_loader_not_found_cjs_hint_relative.mjs
deleted file mode 100644
index 928186318b..0000000000
--- a/test/message/esm_loader_not_found_cjs_hint_relative.mjs
+++ /dev/null
@@ -1,3 +0,0 @@
-// Flags: --experimental-loader ./test/common/fixtures
-import '../common/index.mjs';
-console.log('This should not be printed');
diff --git a/test/message/esm_loader_not_found_cjs_hint_relative.out b/test/message/esm_loader_not_found_cjs_hint_relative.out
deleted file mode 100644
index 0bd9ab7336..0000000000
--- a/test/message/esm_loader_not_found_cjs_hint_relative.out
+++ /dev/null
@@ -1,22 +0,0 @@
-(node:*) ExperimentalWarning: --experimental-loader is an experimental feature. This feature could change at any time
-(Use `* --trace-warnings ...` to show where the warning was created)
-node:internal/process/esm_loader:*
- internalBinding('errors').triggerUncaughtException(
- ^
-
-Error [ERR_MODULE_NOT_FOUND]: Cannot find module '*test*common*fixtures' imported from *
-Did you mean to import ./test/common/fixtures.js?
- at new NodeError (node:internal/errors:*:*)
- at finalizeResolution (node:internal/modules/esm/resolve:*:*)
- at moduleResolve (node:internal/modules/esm/resolve:*:*)
- at defaultResolve (node:internal/modules/esm/resolve:*:*)
- at ESMLoader.resolve (node:internal/modules/esm/loader:*:*)
- at ESMLoader.getModuleJob (node:internal/modules/esm/loader:*:*)
- at ESMLoader.import (node:internal/modules/esm/loader:*:*)
- at initializeLoader (node:internal/process/esm_loader:*:*)
- at loadESM (node:internal/process/esm_loader:*:*)
- at runMainESM (node:internal/modules/run_main:*:*) {
- code: 'ERR_MODULE_NOT_FOUND'
-}
-
-Node.js *
diff --git a/test/message/esm_loader_syntax_error.mjs b/test/message/esm_loader_syntax_error.mjs
deleted file mode 100644
index 68cde42e58..0000000000
--- a/test/message/esm_loader_syntax_error.mjs
+++ /dev/null
@@ -1,3 +0,0 @@
-// Flags: --experimental-loader ./test/fixtures/es-module-loaders/syntax-error.mjs
-import '../common/index.mjs';
-console.log('This should not be printed');
diff --git a/test/message/esm_loader_syntax_error.out b/test/message/esm_loader_syntax_error.out
deleted file mode 100644
index fdced9fc96..0000000000
--- a/test/message/esm_loader_syntax_error.out
+++ /dev/null
@@ -1,12 +0,0 @@
-(node:*) ExperimentalWarning: --experimental-loader is an experimental feature. This feature could change at any time
-(Use `* --trace-warnings ...` to show where the warning was created)
-file://*/test/fixtures/es-module-loaders/syntax-error.mjs:2
-await async () => 0;
-^^^^^^^^^^^^^
-
-SyntaxError: Malformed arrow function parameter list
- at ESMLoader.moduleStrategy (node:internal/modules/esm/translators:*:*)
- at ESMLoader.moduleProvider (node:internal/modules/esm/loader:*:*)
- at async link (node:internal/modules/esm/module_job:*:*)
-
-Node.js *
diff --git a/test/message/test-esm-loader-obsolete-hooks.mjs b/test/message/test-esm-loader-obsolete-hooks.mjs
deleted file mode 100644
index 9a6a9c4805..0000000000
--- a/test/message/test-esm-loader-obsolete-hooks.mjs
+++ /dev/null
@@ -1,4 +0,0 @@
-// Flags: --no-warnings --throw-deprecation --experimental-loader ./test/fixtures/es-module-loaders/hooks-obsolete.mjs
-/* eslint-disable node-core/require-common-first, node-core/required-modules */
-
-await import('whatever');
diff --git a/test/message/test-esm-loader-obsolete-hooks.out b/test/message/test-esm-loader-obsolete-hooks.out
deleted file mode 100644
index 5453cefe20..0000000000
--- a/test/message/test-esm-loader-obsolete-hooks.out
+++ /dev/null
@@ -1,11 +0,0 @@
-node:internal/process/warning:*
- throw warning;
- ^
-
-DeprecationWarning: Obsolete loader hook(s) supplied and will be ignored: dynamicInstantiate, getFormat, getSource, transformSource
- at Function.pluckHooks (node:internal/modules/esm/loader:*:*)
- at ESMLoader.addCustomLoaders (node:internal/modules/esm/loader:*:*)
- at initializeLoader (node:internal/process/esm_loader:*:*)
- at async loadESM (node:internal/process/esm_loader:*:*)
- at async handleMainPromise (node:internal/modules/run_main:*:*)
-Node.js * \ No newline at end of file