diff options
author | Guy Bedford <guybedford@gmail.com> | 2019-10-11 17:57:13 -0400 |
---|---|---|
committer | Myles Borins <mylesborins@google.com> | 2019-11-12 14:04:55 -0800 |
commit | 796f3d0af49164314868c4778af90eca356f1fef (patch) | |
tree | f1b8d619df36917b03ba035630f389e1da305712 /test | |
parent | cc6f99de449beb0993db3647de4ef979bead804d (diff) | |
download | android-node-v8-796f3d0af49164314868c4778af90eca356f1fef.tar.gz android-node-v8-796f3d0af49164314868c4778af90eca356f1fef.tar.bz2 android-node-v8-796f3d0af49164314868c4778af90eca356f1fef.zip |
esm: unflag --experimental-modules
PR-URL: https://github.com/nodejs/node/pull/29866
Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Diffstat (limited to 'test')
81 files changed, 79 insertions, 149 deletions
diff --git a/test/common/index.mjs b/test/common/index.mjs index f747ee3279..5ad6ec3c11 100644 --- a/test/common/index.mjs +++ b/test/common/index.mjs @@ -1,4 +1,3 @@ -// Flags: --experimental-modules /* eslint-disable node-core/require-common-first, node-core/required-modules */ import { createRequire } from 'module'; diff --git a/test/es-module/test-cjs-esm-warn.js b/test/es-module/test-cjs-esm-warn.js index ec368c73e2..b1b2e7f434 100644 --- a/test/es-module/test-cjs-esm-warn.js +++ b/test/es-module/test-cjs-esm-warn.js @@ -23,10 +23,10 @@ child.stderr.on('data', (data) => { stderr += data; }); child.on('close', common.mustCall((code, signal) => { - assert.strictEqual(code, 0); + assert.strictEqual(code, 1); assert.strictEqual(signal, null); - assert.strictEqual(stderr, `(node:${child.pid}) Warning: ` + + assert.ok(stderr.startsWith(`(node:${child.pid}) Warning: ` + 'require() of ES modules is not supported.\nrequire() of ' + `${required} from ${requiring} ` + 'is an ES module file as it is a .js file whose nearest parent ' + @@ -34,5 +34,7 @@ child.on('close', common.mustCall((code, signal) => { 'files in that package scope as ES modules.\nInstead rename ' + `${basename} to end in .cjs, change the requiring code to use ` + 'import(), or remove "type": "module" from ' + - `${pjson}.\n`); + `${pjson}.\n`)); + assert.ok(stderr.indexOf( + 'Error [ERR_REQUIRE_ESM]: Must use import to load ES Module') !== -1); })); diff --git a/test/es-module/test-esm-basic-imports.mjs b/test/es-module/test-esm-basic-imports.mjs index c21804d78b..5009fbadb3 100644 --- a/test/es-module/test-esm-basic-imports.mjs +++ b/test/es-module/test-esm-basic-imports.mjs @@ -1,4 +1,3 @@ -// Flags: --experimental-modules import '../common/index.mjs'; import assert from 'assert'; import ok from '../fixtures/es-modules/test-esm-ok.mjs'; diff --git a/test/es-module/test-esm-cjs-load-error-note.mjs b/test/es-module/test-esm-cjs-load-error-note.mjs index ce0d1d7969..c0ac9393a8 100644 --- a/test/es-module/test-esm-cjs-load-error-note.mjs +++ b/test/es-module/test-esm-cjs-load-error-note.mjs @@ -1,5 +1,3 @@ -// Flags: --experimental-modules - import { mustCall } from '../common/index.mjs'; import assert from 'assert'; import fixtures from '../common/fixtures.js'; @@ -20,7 +18,7 @@ const expectedNote = 'To load an ES module, ' + const expectedCode = 1; -const pExport1 = spawn(process.execPath, ['--experimental-modules', Export1]); +const pExport1 = spawn(process.execPath, [Export1]); let pExport1Stderr = ''; pExport1.stderr.setEncoding('utf8'); pExport1.stderr.on('data', (data) => { @@ -33,7 +31,7 @@ pExport1.on('close', mustCall((code) => { })); -const pExport2 = spawn(process.execPath, ['--experimental-modules', Export2]); +const pExport2 = spawn(process.execPath, [Export2]); let pExport2Stderr = ''; pExport2.stderr.setEncoding('utf8'); pExport2.stderr.on('data', (data) => { @@ -44,21 +42,8 @@ pExport2.on('close', mustCall((code) => { assert.ok(pExport2Stderr.includes(expectedNote), `${expectedNote} not found in ${pExport2Stderr}`); })); -// The flag --experimental-modules is not used here -// the note must not be included in the output -const pExport3 = spawn(process.execPath, [Export1]); -let pExport3Stderr = ''; -pExport3.stderr.setEncoding('utf8'); -pExport3.stderr.on('data', (data) => { - pExport3Stderr += data; -}); -pExport3.on('close', mustCall((code) => { - assert.strictEqual(code, expectedCode); - assert.ok(!pExport3Stderr.includes(expectedNote), - `${expectedNote} must not be included in ${pExport3Stderr}`); -})); -const pImport1 = spawn(process.execPath, ['--experimental-modules', Import1]); +const pImport1 = spawn(process.execPath, [Import1]); let pImport1Stderr = ''; pImport1.stderr.setEncoding('utf8'); pImport1.stderr.on('data', (data) => { @@ -71,7 +56,7 @@ pImport1.on('close', mustCall((code) => { })); // Note this test shouldn't include the note -const pImport2 = spawn(process.execPath, ['--experimental-modules', Import2]); +const pImport2 = spawn(process.execPath, [Import2]); let pImport2Stderr = ''; pImport2.stderr.setEncoding('utf8'); pImport2.stderr.on('data', (data) => { @@ -84,7 +69,7 @@ pImport2.on('close', mustCall((code) => { `${expectedNote} must not be included in ${pImport2Stderr}`); })); -const pImport3 = spawn(process.execPath, ['--experimental-modules', Import3]); +const pImport3 = spawn(process.execPath, [Import3]); let pImport3Stderr = ''; pImport3.stderr.setEncoding('utf8'); pImport3.stderr.on('data', (data) => { @@ -97,7 +82,7 @@ pImport3.on('close', mustCall((code) => { })); -const pImport4 = spawn(process.execPath, ['--experimental-modules', Import4]); +const pImport4 = spawn(process.execPath, [Import4]); let pImport4Stderr = ''; pImport4.stderr.setEncoding('utf8'); pImport4.stderr.on('data', (data) => { @@ -110,7 +95,7 @@ pImport4.on('close', mustCall((code) => { })); // Must exit with zero and show note -const pImport5 = spawn(process.execPath, ['--experimental-modules', Import5]); +const pImport5 = spawn(process.execPath, [Import5]); let pImport5Stderr = ''; pImport5.stderr.setEncoding('utf8'); pImport5.stderr.on('data', (data) => { @@ -121,16 +106,3 @@ pImport5.on('close', mustCall((code) => { assert.ok(!pImport5Stderr.includes(expectedNote), `${expectedNote} must not be included in ${pImport5Stderr}`); })); - -// Must exit with zero and not show note -const pImport6 = spawn(process.execPath, [Import1]); -let pImport6Stderr = ''; -pImport6.stderr.setEncoding('utf8'); -pImport6.stderr.on('data', (data) => { - pImport6Stderr += data; -}); -pImport6.on('close', mustCall((code) => { - assert.strictEqual(code, expectedCode); - assert.ok(!pImport6Stderr.includes(expectedNote), - `${expectedNote} must not be included in ${pImport6Stderr}`); -})); diff --git a/test/es-module/test-esm-cjs-main.js b/test/es-module/test-esm-cjs-main.js index 8308308a2d..92f4124cca 100644 --- a/test/es-module/test-esm-cjs-main.js +++ b/test/es-module/test-esm-cjs-main.js @@ -7,12 +7,8 @@ const assert = require('assert'); const entry = fixtures.path('/es-modules/cjs.js'); -const child = spawn(process.execPath, ['--experimental-modules', entry]); -let stderr = ''; +const child = spawn(process.execPath, [entry]); child.stderr.setEncoding('utf8'); -child.stderr.on('data', (data) => { - stderr += data; -}); let stdout = ''; child.stdout.setEncoding('utf8'); child.stdout.on('data', (data) => { @@ -22,6 +18,4 @@ child.on('close', common.mustCall((code, signal) => { assert.strictEqual(code, 0); assert.strictEqual(signal, null); assert.strictEqual(stdout, 'executed\n'); - assert.strictEqual(stderr, `(node:${child.pid}) ` + - 'ExperimentalWarning: The ESM module loader is experimental.\n'); })); diff --git a/test/es-module/test-esm-cyclic-dynamic-import.mjs b/test/es-module/test-esm-cyclic-dynamic-import.mjs index 03d405baf3..6f831470b7 100644 --- a/test/es-module/test-esm-cyclic-dynamic-import.mjs +++ b/test/es-module/test-esm-cyclic-dynamic-import.mjs @@ -1,3 +1,2 @@ -// Flags: --experimental-modules import '../common/index.mjs'; import('./test-esm-cyclic-dynamic-import.mjs'); diff --git a/test/es-module/test-esm-data-urls.js b/test/es-module/test-esm-data-urls.js index bc781b0363..f2f166b47e 100644 --- a/test/es-module/test-esm-data-urls.js +++ b/test/es-module/test-esm-data-urls.js @@ -1,4 +1,3 @@ -// Flags: --experimental-modules 'use strict'; const common = require('../common'); const assert = require('assert'); diff --git a/test/es-module/test-esm-default-type.mjs b/test/es-module/test-esm-default-type.mjs index 7e63dab349..4b758df916 100644 --- a/test/es-module/test-esm-default-type.mjs +++ b/test/es-module/test-esm-default-type.mjs @@ -1,4 +1,3 @@ -// Flags: --experimental-modules import '../common/index.mjs'; import { strictEqual } from 'assert'; diff --git a/test/es-module/test-esm-double-encoding.mjs b/test/es-module/test-esm-double-encoding.mjs index 2edfc8add5..e46249f128 100644 --- a/test/es-module/test-esm-double-encoding.mjs +++ b/test/es-module/test-esm-double-encoding.mjs @@ -1,4 +1,3 @@ -// Flags: --experimental-modules import '../common/index.mjs'; // Assert we can import files with `%` in their pathname. diff --git a/test/es-module/test-esm-dynamic-import.js b/test/es-module/test-esm-dynamic-import.js index ca9c99007b..8a92ac41ed 100644 --- a/test/es-module/test-esm-dynamic-import.js +++ b/test/es-module/test-esm-dynamic-import.js @@ -1,5 +1,3 @@ -// Flags: --experimental-modules - 'use strict'; const common = require('../common'); const assert = require('assert'); diff --git a/test/es-module/test-esm-encoded-path-native.js b/test/es-module/test-esm-encoded-path-native.js index a3106742d9..b8f5719b60 100644 --- a/test/es-module/test-esm-encoded-path-native.js +++ b/test/es-module/test-esm-encoded-path-native.js @@ -5,7 +5,7 @@ const assert = require('assert'); const { spawn } = require('child_process'); const native = fixtures.path('es-module-url/native.mjs'); -const child = spawn(process.execPath, ['--experimental-modules', native]); +const child = spawn(process.execPath, [native]); child.on('exit', (code) => { assert.strictEqual(code, 1); }); diff --git a/test/es-module/test-esm-encoded-path.mjs b/test/es-module/test-esm-encoded-path.mjs index efb681ef0b..351cb7eab8 100644 --- a/test/es-module/test-esm-encoded-path.mjs +++ b/test/es-module/test-esm-encoded-path.mjs @@ -1,4 +1,3 @@ -// Flags: --experimental-modules import '../common/index.mjs'; import assert from 'assert'; // ./test-esm-ok.mjs diff --git a/test/es-module/test-esm-error-cache.js b/test/es-module/test-esm-error-cache.js index 26e0d170ac..b13e793626 100644 --- a/test/es-module/test-esm-error-cache.js +++ b/test/es-module/test-esm-error-cache.js @@ -1,5 +1,3 @@ -// Flags: --experimental-modules - 'use strict'; require('../common'); diff --git a/test/es-module/test-esm-example-loader.js b/test/es-module/test-esm-example-loader.js index 0da1d34d2a..b85de4e64c 100644 --- a/test/es-module/test-esm-example-loader.js +++ b/test/es-module/test-esm-example-loader.js @@ -1,4 +1,4 @@ -// Flags: --experimental-modules --experimental-loader ./test/fixtures/es-module-loaders/example-loader.mjs +// Flags: --experimental-loader ./test/fixtures/es-module-loaders/example-loader.mjs /* eslint-disable node-core/require-common-first, node-core/required-modules */ import assert from 'assert'; import ok from '../fixtures/es-modules/test-esm-ok.mjs'; diff --git a/test/es-module/test-esm-exports.mjs b/test/es-module/test-esm-exports.mjs index 2683b5df68..a361bafaa8 100644 --- a/test/es-module/test-esm-exports.mjs +++ b/test/es-module/test-esm-exports.mjs @@ -1,5 +1,4 @@ -// Flags: --experimental-modules --experimental-resolve-self --experimental-conditional-exports - +// Flags: --experimental-modules import { mustCall } from '../common/index.mjs'; import { ok, deepStrictEqual, strictEqual } from 'assert'; diff --git a/test/es-module/test-esm-forbidden-globals.mjs b/test/es-module/test-esm-forbidden-globals.mjs index b66f278a8a..2f1914e486 100644 --- a/test/es-module/test-esm-forbidden-globals.mjs +++ b/test/es-module/test-esm-forbidden-globals.mjs @@ -1,4 +1,3 @@ -// Flags: --experimental-modules import '../common/index.mjs'; // eslint-disable-next-line no-undef diff --git a/test/es-module/test-esm-import-meta.mjs b/test/es-module/test-esm-import-meta.mjs index 54c14a44f5..0151177b21 100644 --- a/test/es-module/test-esm-import-meta.mjs +++ b/test/es-module/test-esm-import-meta.mjs @@ -1,4 +1,3 @@ -// Flags: --experimental-modules import '../common/index.mjs'; import assert from 'assert'; diff --git a/test/es-module/test-esm-invalid-extension.js b/test/es-module/test-esm-invalid-extension.js index 9e676e57d1..cdf9476b29 100644 --- a/test/es-module/test-esm-invalid-extension.js +++ b/test/es-module/test-esm-invalid-extension.js @@ -4,7 +4,7 @@ const fixtures = require('../common/fixtures'); const assert = require('assert'); const { spawnSync } = require('child_process'); const fixture = fixtures.path('/es-modules/import-invalid-ext.mjs'); -const child = spawnSync(process.execPath, ['--experimental-modules', fixture]); +const child = spawnSync(process.execPath, [fixture]); const errMsg = 'TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension'; assert.strictEqual(child.status, 1); diff --git a/test/es-module/test-esm-json-cache.mjs b/test/es-module/test-esm-json-cache.mjs index d1fee4f444..d08f852e25 100644 --- a/test/es-module/test-esm-json-cache.mjs +++ b/test/es-module/test-esm-json-cache.mjs @@ -1,4 +1,4 @@ -// Flags: --experimental-modules --experimental-json-modules +// Flags: --experimental-json-modules import '../common/index.mjs'; import { strictEqual, deepStrictEqual } from 'assert'; diff --git a/test/es-module/test-esm-json.mjs b/test/es-module/test-esm-json.mjs index 3d246124a9..9dd33f26b5 100644 --- a/test/es-module/test-esm-json.mjs +++ b/test/es-module/test-esm-json.mjs @@ -1,4 +1,4 @@ -// Flags: --experimental-modules --experimental-json-modules +// Flags: --experimental-json-modules import '../common/index.mjs'; import { strictEqual } from 'assert'; diff --git a/test/es-module/test-esm-live-binding.mjs b/test/es-module/test-esm-live-binding.mjs index 4000a621a2..ff58db31f1 100644 --- a/test/es-module/test-esm-live-binding.mjs +++ b/test/es-module/test-esm-live-binding.mjs @@ -1,4 +1,3 @@ -// Flags: --experimental-modules import '../common/index.mjs'; import assert from 'assert'; import { syncBuiltinESMExports } from 'module'; diff --git a/test/es-module/test-esm-loader-cache-clearing.js b/test/es-module/test-esm-loader-cache-clearing.js index ec22b6a6bb..4b5f36cf37 100644 --- a/test/es-module/test-esm-loader-cache-clearing.js +++ b/test/es-module/test-esm-loader-cache-clearing.js @@ -1,4 +1,3 @@ -// Flags: --experimental-modules 'use strict'; require('../common'); diff --git a/test/es-module/test-esm-loader-dependency.mjs b/test/es-module/test-esm-loader-dependency.mjs index dadc3bd84a..54327b478b 100644 --- a/test/es-module/test-esm-loader-dependency.mjs +++ b/test/es-module/test-esm-loader-dependency.mjs @@ -1,4 +1,4 @@ -// Flags: --experimental-modules --experimental-loader ./test/fixtures/es-module-loaders/loader-with-dep.mjs +// Flags: --experimental-loader ./test/fixtures/es-module-loaders/loader-with-dep.mjs /* eslint-disable node-core/require-common-first, node-core/required-modules */ import '../fixtures/es-modules/test-esm-ok.mjs'; diff --git a/test/es-module/test-esm-loader-invalid-format.mjs b/test/es-module/test-esm-loader-invalid-format.mjs index 9e26d646d4..75f5de8380 100644 --- a/test/es-module/test-esm-loader-invalid-format.mjs +++ b/test/es-module/test-esm-loader-invalid-format.mjs @@ -1,4 +1,4 @@ -// Flags: --experimental-modules --experimental-loader ./test/fixtures/es-module-loaders/loader-invalid-format.mjs +// Flags: --experimental-loader ./test/fixtures/es-module-loaders/loader-invalid-format.mjs import { expectsError, mustCall } from '../common/index.mjs'; import assert from 'assert'; diff --git a/test/es-module/test-esm-loader-invalid-url.mjs b/test/es-module/test-esm-loader-invalid-url.mjs index f42900c58e..4007be052d 100644 --- a/test/es-module/test-esm-loader-invalid-url.mjs +++ b/test/es-module/test-esm-loader-invalid-url.mjs @@ -1,4 +1,4 @@ -// Flags: --experimental-modules --experimental-loader ./test/fixtures/es-module-loaders/loader-invalid-url.mjs +// Flags: --experimental-loader ./test/fixtures/es-module-loaders/loader-invalid-url.mjs import { expectsError, mustCall } from '../common/index.mjs'; import assert from 'assert'; diff --git a/test/es-module/test-esm-loader-missing-dynamic-instantiate-hook.mjs b/test/es-module/test-esm-loader-missing-dynamic-instantiate-hook.mjs index 5767af7aff..62781c37d4 100644 --- a/test/es-module/test-esm-loader-missing-dynamic-instantiate-hook.mjs +++ b/test/es-module/test-esm-loader-missing-dynamic-instantiate-hook.mjs @@ -1,4 +1,4 @@ -// Flags: --experimental-modules --experimental-loader ./test/fixtures/es-module-loaders/missing-dynamic-instantiate-hook.mjs +// Flags: --experimental-loader ./test/fixtures/es-module-loaders/missing-dynamic-instantiate-hook.mjs import { expectsError } from '../common/index.mjs'; import('test').catch(expectsError({ diff --git a/test/es-module/test-esm-loader-modulemap.js b/test/es-module/test-esm-loader-modulemap.js index 70f5a10159..5493c6c47c 100644 --- a/test/es-module/test-esm-loader-modulemap.js +++ b/test/es-module/test-esm-loader-modulemap.js @@ -1,5 +1,5 @@ 'use strict'; -// Flags: --expose-internals --experimental-modules +// Flags: --expose-internals // This test ensures that the type checking of ModuleMap throws // errors appropriately diff --git a/test/es-module/test-esm-main-lookup.mjs b/test/es-module/test-esm-main-lookup.mjs index cbc6424dd2..2023a105e4 100644 --- a/test/es-module/test-esm-main-lookup.mjs +++ b/test/es-module/test-esm-main-lookup.mjs @@ -1,4 +1,3 @@ -// Flags: --experimental-modules import '../common/index.mjs'; import assert from 'assert'; diff --git a/test/es-module/test-esm-named-exports.mjs b/test/es-module/test-esm-named-exports.mjs index 6c80308269..7d8d108008 100644 --- a/test/es-module/test-esm-named-exports.mjs +++ b/test/es-module/test-esm-named-exports.mjs @@ -1,4 +1,4 @@ -// Flags: --experimental-modules --experimental-loader ./test/fixtures/es-module-loaders/builtin-named-exports-loader.mjs +// Flags: --experimental-loader ./test/fixtures/es-module-loaders/builtin-named-exports-loader.mjs import '../common/index.mjs'; import { readFile } from 'fs'; import assert from 'assert'; diff --git a/test/es-module/test-esm-namespace.mjs b/test/es-module/test-esm-namespace.mjs index 094a9e972c..9ce0f9686d 100644 --- a/test/es-module/test-esm-namespace.mjs +++ b/test/es-module/test-esm-namespace.mjs @@ -1,4 +1,3 @@ -// Flags: --experimental-modules import '../common/index.mjs'; import * as fs from 'fs'; import assert from 'assert'; diff --git a/test/es-module/test-esm-no-extension.js b/test/es-module/test-esm-no-extension.js index 81b8e5b432..392bb5638b 100644 --- a/test/es-module/test-esm-no-extension.js +++ b/test/es-module/test-esm-no-extension.js @@ -10,10 +10,7 @@ const entry = fixtures.path('/es-modules/package-type-module/noext-esm'); // Run a module that does not have extension. // This is to ensure that "type": "module" applies to extensionless files. -const child = spawn(process.execPath, [ - '--experimental-modules', - entry -]); +const child = spawn(process.execPath, [entry]); let stdout = ''; child.stdout.setEncoding('utf8'); diff --git a/test/es-module/test-esm-pkgname.mjs b/test/es-module/test-esm-pkgname.mjs index 046a12dd1a..06b5d2d104 100644 --- a/test/es-module/test-esm-pkgname.mjs +++ b/test/es-module/test-esm-pkgname.mjs @@ -1,5 +1,3 @@ -// Flags: --experimental-modules - import { mustCall } from '../common/index.mjs'; import { strictEqual } from 'assert'; diff --git a/test/es-module/test-esm-preserve-symlinks-main.js b/test/es-module/test-esm-preserve-symlinks-main.js index 239fdddc2e..877066a6a4 100644 --- a/test/es-module/test-esm-preserve-symlinks-main.js +++ b/test/es-module/test-esm-preserve-symlinks-main.js @@ -53,5 +53,5 @@ function doTest(flags, done) { // First test the commonjs module loader doTest([], () => { // Now test the new loader - doTest(['--experimental-modules'], () => {}); + doTest([], () => {}); }); diff --git a/test/es-module/test-esm-preserve-symlinks-not-found-plain.mjs b/test/es-module/test-esm-preserve-symlinks-not-found-plain.mjs index 1dcae4b8ae..7a538e44c0 100644 --- a/test/es-module/test-esm-preserve-symlinks-not-found-plain.mjs +++ b/test/es-module/test-esm-preserve-symlinks-not-found-plain.mjs @@ -1,3 +1,3 @@ -// Flags: --experimental-modules --experimental-loader ./test/fixtures/es-module-loaders/not-found-assert-loader.mjs +// Flags: --experimental-loader ./test/fixtures/es-module-loaders/not-found-assert-loader.mjs /* eslint-disable node-core/require-common-first, node-core/required-modules */ import './not-found.js'; diff --git a/test/es-module/test-esm-preserve-symlinks-not-found.mjs b/test/es-module/test-esm-preserve-symlinks-not-found.mjs index 68e1b53eeb..722dc467d1 100644 --- a/test/es-module/test-esm-preserve-symlinks-not-found.mjs +++ b/test/es-module/test-esm-preserve-symlinks-not-found.mjs @@ -1,3 +1,3 @@ -// Flags: --experimental-modules --experimental-loader ./test/fixtures/es-module-loaders/not-found-assert-loader.mjs +// Flags: --experimental-loader ./test/fixtures/es-module-loaders/not-found-assert-loader.mjs /* eslint-disable node-core/require-common-first, node-core/required-modules */ import './not-found.mjs'; diff --git a/test/es-module/test-esm-preserve-symlinks.js b/test/es-module/test-esm-preserve-symlinks.js index 28cba3e702..a91373b0c0 100644 --- a/test/es-module/test-esm-preserve-symlinks.js +++ b/test/es-module/test-esm-preserve-symlinks.js @@ -32,7 +32,7 @@ try { } spawn(process.execPath, - ['--experimental-modules', '--preserve-symlinks', entry], + ['--preserve-symlinks', entry], { stdio: 'inherit' }).on('exit', (code) => { assert.strictEqual(code, 0); }); diff --git a/test/es-module/test-esm-process.mjs b/test/es-module/test-esm-process.mjs index a2b0d31f1e..8fa006a304 100644 --- a/test/es-module/test-esm-process.mjs +++ b/test/es-module/test-esm-process.mjs @@ -1,4 +1,3 @@ -// Flags: --experimental-modules import '../common/index.mjs'; import assert from 'assert'; import process from 'process'; diff --git a/test/es-module/test-esm-repl.js b/test/es-module/test-esm-repl.js index daef48d8e1..653927b241 100644 --- a/test/es-module/test-esm-repl.js +++ b/test/es-module/test-esm-repl.js @@ -4,7 +4,6 @@ const assert = require('assert'); const { spawn } = require('child_process'); const child = spawn(process.execPath, [ - '--experimental-modules', '--interactive' ]); child.stdin.end(` diff --git a/test/es-module/test-esm-require-cache.mjs b/test/es-module/test-esm-require-cache.mjs index 8c126c39e0..1cfcf8e2a4 100644 --- a/test/es-module/test-esm-require-cache.mjs +++ b/test/es-module/test-esm-require-cache.mjs @@ -1,4 +1,3 @@ -// Flags: --experimental-modules import { createRequire } from '../common/index.mjs'; import assert from 'assert'; // diff --git a/test/es-module/test-esm-resolve-hook.mjs b/test/es-module/test-esm-resolve-hook.mjs index 00c8e440f4..39b11e0273 100644 --- a/test/es-module/test-esm-resolve-hook.mjs +++ b/test/es-module/test-esm-resolve-hook.mjs @@ -1,4 +1,4 @@ -// Flags: --experimental-modules --experimental-loader ./test/fixtures/es-module-loaders/js-loader.mjs +// Flags: --experimental-loader ./test/fixtures/es-module-loaders/js-loader.mjs /* eslint-disable node-core/require-common-first, node-core/required-modules */ import { namedExport } from '../fixtures/es-module-loaders/js-as-esm.js'; import assert from 'assert'; diff --git a/test/es-module/test-esm-scope-node-modules.mjs b/test/es-module/test-esm-scope-node-modules.mjs index 8358da5c76..0be4194aeb 100644 --- a/test/es-module/test-esm-scope-node-modules.mjs +++ b/test/es-module/test-esm-scope-node-modules.mjs @@ -1,4 +1,3 @@ -// Flags: --experimental-modules import '../common/index.mjs'; import cjs from '../fixtures/baz.js'; import { message } from '../fixtures/es-modules/message.mjs'; diff --git a/test/es-module/test-esm-shared-loader-dep.mjs b/test/es-module/test-esm-shared-loader-dep.mjs index b02e557d34..e0015bd0c7 100644 --- a/test/es-module/test-esm-shared-loader-dep.mjs +++ b/test/es-module/test-esm-shared-loader-dep.mjs @@ -1,4 +1,4 @@ -// Flags: --experimental-modules --experimental-loader ./test/fixtures/es-module-loaders/loader-shared-dep.mjs +// Flags: --experimental-loader ./test/fixtures/es-module-loaders/loader-shared-dep.mjs import { createRequire } from '../common/index.mjs'; import assert from 'assert'; diff --git a/test/es-module/test-esm-shebang.mjs b/test/es-module/test-esm-shebang.mjs index 1d22551bd7..6b77151dd7 100644 --- a/test/es-module/test-esm-shebang.mjs +++ b/test/es-module/test-esm-shebang.mjs @@ -1,5 +1,4 @@ #! }]) // isn't js -// Flags: --experimental-modules import '../common/index.mjs'; const isJs = true; diff --git a/test/es-module/test-esm-snapshot.mjs b/test/es-module/test-esm-snapshot.mjs index 99767f10e2..e2695d20a8 100644 --- a/test/es-module/test-esm-snapshot.mjs +++ b/test/es-module/test-esm-snapshot.mjs @@ -1,4 +1,3 @@ -// Flags: --experimental-modules import '../common/index.mjs'; import '../fixtures/es-modules/esm-snapshot-mutator.js'; import one from '../fixtures/es-modules/esm-snapshot.js'; diff --git a/test/es-module/test-esm-specifiers.mjs b/test/es-module/test-esm-specifiers.mjs index 59d54cbf63..3e7bc18196 100644 --- a/test/es-module/test-esm-specifiers.mjs +++ b/test/es-module/test-esm-specifiers.mjs @@ -1,4 +1,4 @@ -// Flags: --experimental-modules --es-module-specifier-resolution=node +// Flags: --es-module-specifier-resolution=node import { mustNotCall } from '../common/index.mjs'; import assert from 'assert'; diff --git a/test/es-module/test-esm-symlink-main.js b/test/es-module/test-esm-symlink-main.js index 871180f5cc..48b4d8bbe6 100644 --- a/test/es-module/test-esm-symlink-main.js +++ b/test/es-module/test-esm-symlink-main.js @@ -19,7 +19,7 @@ try { } spawn(process.execPath, - ['--experimental-modules', '--preserve-symlinks', symlinkPath], + ['--preserve-symlinks', symlinkPath], { stdio: 'inherit' }).on('exit', (code) => { assert.strictEqual(code, 0); }); diff --git a/test/es-module/test-esm-symlink-type.js b/test/es-module/test-esm-symlink-type.js index 6159ebecd1..1f46dce17f 100644 --- a/test/es-module/test-esm-symlink-type.js +++ b/test/es-module/test-esm-symlink-type.js @@ -48,8 +48,8 @@ symlinks.forEach((symlink) => { fs.symlinkSync(symlink.target, mainPath); const flags = [ - '--experimental-modules', - '--experimental-modules --preserve-symlinks-main' + '', + '--preserve-symlinks-main' ]; flags.forEach((nodeOptions) => { const opts = { diff --git a/test/es-module/test-esm-symlink.js b/test/es-module/test-esm-symlink.js index 9b9eb98cd9..139e6820ed 100644 --- a/test/es-module/test-esm-symlink.js +++ b/test/es-module/test-esm-symlink.js @@ -41,7 +41,7 @@ try { common.skip('insufficient privileges for symlinks'); } -spawn(process.execPath, ['--experimental-modules', entry], +spawn(process.execPath, [entry], { stdio: 'inherit' }).on('exit', (code) => { assert.strictEqual(code, 0); }); diff --git a/test/es-module/test-esm-throw-undefined.mjs b/test/es-module/test-esm-throw-undefined.mjs index 4c091e6153..c4c25fd12d 100644 --- a/test/es-module/test-esm-throw-undefined.mjs +++ b/test/es-module/test-esm-throw-undefined.mjs @@ -1,4 +1,3 @@ -// Flags: --experimental-modules import '../common/index.mjs'; import assert from 'assert'; diff --git a/test/es-module/test-esm-type-flag-errors.js b/test/es-module/test-esm-type-flag-errors.js index 8725fb6232..5d19cedd84 100644 --- a/test/es-module/test-esm-type-flag-errors.js +++ b/test/es-module/test-esm-type-flag-errors.js @@ -1,4 +1,3 @@ -// Flags: --experimental-modules 'use strict'; const common = require('../common'); const assert = require('assert'); @@ -32,8 +31,6 @@ try { } function expect(opt = '', inputFile, want, wantsError = false) { - // TODO: Remove when --experimental-modules is unflagged - opt = `--experimental-modules ${opt}`; const argv = [inputFile]; const opts = { env: Object.assign({}, process.env, { NODE_OPTIONS: opt }), diff --git a/test/es-module/test-esm-type-flag.mjs b/test/es-module/test-esm-type-flag.mjs index 8358da5c76..0be4194aeb 100644 --- a/test/es-module/test-esm-type-flag.mjs +++ b/test/es-module/test-esm-type-flag.mjs @@ -1,4 +1,3 @@ -// Flags: --experimental-modules import '../common/index.mjs'; import cjs from '../fixtures/baz.js'; import { message } from '../fixtures/es-modules/message.mjs'; diff --git a/test/es-module/test-esm-wasm.mjs b/test/es-module/test-esm-wasm.mjs index bcfce797a9..46df5994af 100644 --- a/test/es-module/test-esm-wasm.mjs +++ b/test/es-module/test-esm-wasm.mjs @@ -1,4 +1,4 @@ -// Flags: --experimental-modules --experimental-wasm-modules +// Flags: --experimental-wasm-modules import '../common/index.mjs'; import { add, addImported } from '../fixtures/es-modules/simple.wasm'; import { state } from '../fixtures/es-modules/wasm-dep.mjs'; diff --git a/test/es-module/test-esm-windows.js b/test/es-module/test-esm-windows.js index 64ba1249a7..c4d9ff4cde 100644 --- a/test/es-module/test-esm-windows.js +++ b/test/es-module/test-esm-windows.js @@ -1,6 +1,5 @@ 'use strict'; -// Flags: --experimental-modules // This test ensures that JavaScript file that includes // a reserved Windows word can be loaded as ESM module diff --git a/test/message/async_error_eval_esm.js b/test/message/async_error_eval_esm.js index 33675b5a9d..0c9b7378d5 100644 --- a/test/message/async_error_eval_esm.js +++ b/test/message/async_error_eval_esm.js @@ -26,7 +26,6 @@ main(); // --eval ESM { const child = spawnSync(process.execPath, [ - '--experimental-modules', '--input-type', 'module', '-e', diff --git a/test/message/async_error_eval_esm.out b/test/message/async_error_eval_esm.out index 578a9f5c26..769fac7a0d 100644 --- a/test/message/async_error_eval_esm.out +++ b/test/message/async_error_eval_esm.out @@ -1,7 +1,6 @@ Error: test at one (file:*/[eval1]:2:9) at two (file:*/[eval1]:15:9) - at processTicksAndRejections (internal/process/task_queues.js:*:*) at async three (file:*/[eval1]:18:3) at async four (file:*/[eval1]:22:3) at async main (file:*/[eval1]:28:5) diff --git a/test/message/async_error_sync_esm.mjs b/test/message/async_error_sync_esm.mjs index f16256d777..fdb6a260d1 100644 --- a/test/message/async_error_sync_esm.mjs +++ b/test/message/async_error_sync_esm.mjs @@ -1,4 +1,3 @@ -// Flags: --experimental-modules import '../common/index.mjs'; import four from '../fixtures/async-error.js'; diff --git a/test/message/async_error_sync_esm.out b/test/message/async_error_sync_esm.out index f34628ef44..6577fff694 100644 --- a/test/message/async_error_sync_esm.out +++ b/test/message/async_error_sync_esm.out @@ -4,4 +4,4 @@ Error: test at two (*fixtures*async-error.js:17:9) at async three (*fixtures*async-error.js:20:3) at async four (*fixtures*async-error.js:24:3) - at async main (*message*async_error_sync_esm.mjs:7:5) + at async main (*message*async_error_sync_esm.mjs:6:5) diff --git a/test/message/esm_display_syntax_error.mjs b/test/message/esm_display_syntax_error.mjs index 8291867255..bda4a7e6eb 100644 --- a/test/message/esm_display_syntax_error.mjs +++ b/test/message/esm_display_syntax_error.mjs @@ -1,3 +1,2 @@ -// Flags: --experimental-modules 'use strict'; await async () => 0; diff --git a/test/message/esm_display_syntax_error.out b/test/message/esm_display_syntax_error.out index 5e82a1e1ee..778d901129 100644 --- a/test/message/esm_display_syntax_error.out +++ b/test/message/esm_display_syntax_error.out @@ -1,5 +1,5 @@ (node:*) ExperimentalWarning: The ESM module loader is experimental. -file:///*/test/message/esm_display_syntax_error.mjs:3 +file:///*/test/message/esm_display_syntax_error.mjs:2 await async () => 0; ^^^^^ diff --git a/test/message/esm_display_syntax_error_import.mjs b/test/message/esm_display_syntax_error_import.mjs index 4c41b292ef..2173cb2b2e 100644 --- a/test/message/esm_display_syntax_error_import.mjs +++ b/test/message/esm_display_syntax_error_import.mjs @@ -1,4 +1,3 @@ -// Flags: --experimental-modules /* eslint-disable no-unused-vars */ import '../common/index.mjs'; import { diff --git a/test/message/esm_display_syntax_error_import.out b/test/message/esm_display_syntax_error_import.out index a3601d6cb4..e39744a049 100644 --- a/test/message/esm_display_syntax_error_import.out +++ b/test/message/esm_display_syntax_error_import.out @@ -1,5 +1,5 @@ (node:*) ExperimentalWarning: The ESM module loader is experimental. -file:///*/test/message/esm_display_syntax_error_import.mjs:6 +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' diff --git a/test/message/esm_display_syntax_error_import_module.mjs b/test/message/esm_display_syntax_error_import_module.mjs index 346b3489fd..c0345c44fb 100644 --- a/test/message/esm_display_syntax_error_import_module.mjs +++ b/test/message/esm_display_syntax_error_import_module.mjs @@ -1,3 +1,2 @@ -// Flags: --experimental-modules import '../common/index.mjs'; import '../fixtures/es-module-loaders/syntax-error-import.mjs'; diff --git a/test/message/esm_display_syntax_error_module.mjs b/test/message/esm_display_syntax_error_module.mjs index 1f2b87ecd0..da40a4ead8 100644 --- a/test/message/esm_display_syntax_error_module.mjs +++ b/test/message/esm_display_syntax_error_module.mjs @@ -1,3 +1,2 @@ -// Flags: --experimental-modules import '../common/index.mjs'; import '../fixtures/es-module-loaders/syntax-error.mjs'; diff --git a/test/message/esm_loader_not_found.mjs b/test/message/esm_loader_not_found.mjs index fd6f29ac53..2b47e5a03e 100644 --- a/test/message/esm_loader_not_found.mjs +++ b/test/message/esm_loader_not_found.mjs @@ -1,3 +1,3 @@ -// Flags: --experimental-modules --experimental-loader i-dont-exist +// Flags: --experimental-loader i-dont-exist import '../common/index.mjs'; console.log('This should not be printed'); diff --git a/test/message/esm_loader_syntax_error.mjs b/test/message/esm_loader_syntax_error.mjs index 7caad4056e..68cde42e58 100644 --- a/test/message/esm_loader_syntax_error.mjs +++ b/test/message/esm_loader_syntax_error.mjs @@ -1,3 +1,3 @@ -// Flags: --experimental-modules --experimental-loader ./test/fixtures/es-module-loaders/syntax-error.mjs +// 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/parallel/test-bootstrap-modules.js b/test/parallel/test-bootstrap-modules.js index c963630f5d..40d37c3b8f 100644 --- a/test/parallel/test-bootstrap-modules.js +++ b/test/parallel/test-bootstrap-modules.js @@ -48,6 +48,13 @@ const expectedModules = new Set([ 'NativeModule internal/linkedlist', 'NativeModule internal/modules/cjs/helpers', 'NativeModule internal/modules/cjs/loader', + 'NativeModule internal/modules/esm/create_dynamic_module', + 'NativeModule internal/modules/esm/default_resolve', + 'NativeModule internal/modules/esm/loader', + 'NativeModule internal/modules/esm/module_job', + 'NativeModule internal/modules/esm/module_map', + 'NativeModule internal/modules/esm/translators', + 'NativeModule internal/process/esm_loader', 'NativeModule internal/options', 'NativeModule internal/priority_queue', 'NativeModule internal/process/execution', @@ -64,6 +71,7 @@ const expectedModules = new Set([ 'NativeModule internal/util/inspect', 'NativeModule internal/util/types', 'NativeModule internal/validators', + 'NativeModule internal/vm/module', 'NativeModule path', 'NativeModule timers', 'NativeModule url', diff --git a/test/parallel/test-cli-eval.js b/test/parallel/test-cli-eval.js index 0d2ea48c06..2cece62a43 100644 --- a/test/parallel/test-cli-eval.js +++ b/test/parallel/test-cli-eval.js @@ -234,7 +234,7 @@ child.exec(`${nodejs} --use-strict -p process.execArgv`, // Assert that "42\n" is written to stdout on module eval. -const execOptions = '--experimental-modules --input-type module'; +const execOptions = '--input-type module'; child.exec( `${nodejs} ${execOptions} --eval "console.log(42)"`, common.mustCall((err, stdout) => { diff --git a/test/parallel/test-cli-syntax-piped-bad.js b/test/parallel/test-cli-syntax-piped-bad.js index 5da5f07e57..abd924848f 100644 --- a/test/parallel/test-cli-syntax-piped-bad.js +++ b/test/parallel/test-cli-syntax-piped-bad.js @@ -39,7 +39,7 @@ syntaxArgs.forEach(function(arg) { const stdin = 'export var p = 5; var foo bar;'; const c = spawnSync( node, - ['--experimental-modules', '--input-type=module', '--no-warnings', arg], + ['--input-type=module', '--no-warnings', arg], { encoding: 'utf8', input: stdin } ); diff --git a/test/parallel/test-cli-syntax-piped-good.js b/test/parallel/test-cli-syntax-piped-good.js index 5df5eb1c51..43de5d32f4 100644 --- a/test/parallel/test-cli-syntax-piped-good.js +++ b/test/parallel/test-cli-syntax-piped-good.js @@ -30,7 +30,7 @@ syntaxArgs.forEach(function(arg) { const stdin = 'export var p = 5; throw new Error("should not get run");'; const c = spawnSync( node, - ['--experimental-modules', '--no-warnings', '--input-type=module', arg], + ['--no-warnings', '--input-type=module', arg], { encoding: 'utf8', input: stdin } ); diff --git a/test/parallel/test-dns-lookupService.js b/test/parallel/test-dns-lookupService.js index f78e987660..dc04893c28 100644 --- a/test/parallel/test-dns-lookupService.js +++ b/test/parallel/test-dns-lookupService.js @@ -5,11 +5,17 @@ const assert = require('assert'); const { internalBinding } = require('internal/test/binding'); const cares = internalBinding('cares_wrap'); const { UV_ENOENT } = internalBinding('uv'); -const dns = require('dns'); // Stub `getnameinfo` to *always* error. cares.getnameinfo = () => UV_ENOENT; +// Because dns promises is attached lazily, +// and turn accesses getnameinfo on init +// but this lazy access is triggered by ES named +// instead of lazily itself, we must require +// dns after hooking cares +const dns = require('dns'); + assert.throws( () => dns.lookupService('127.0.0.1', 80, common.mustNotCall()), { diff --git a/test/parallel/test-inspector-esm.js b/test/parallel/test-inspector-esm.js index b5f55b68d7..f0848d2942 100644 --- a/test/parallel/test-inspector-esm.js +++ b/test/parallel/test-inspector-esm.js @@ -99,8 +99,8 @@ async function testBreakpoint(session) { } async function runTest() { - const child = new NodeInstance(['--inspect-brk=0', '--experimental-modules'], - '', fixtures.path('es-modules/loop.mjs')); + const child = new NodeInstance(['--inspect-brk=0'], '', + fixtures.path('es-modules/loop.mjs')); const session = await child.connectInspectorSession(); await testBreakpointOnStart(session); diff --git a/test/parallel/test-loaders-unknown-builtin-module.mjs b/test/parallel/test-loaders-unknown-builtin-module.mjs index b0b1d400e6..464dbeb22a 100644 --- a/test/parallel/test-loaders-unknown-builtin-module.mjs +++ b/test/parallel/test-loaders-unknown-builtin-module.mjs @@ -1,4 +1,4 @@ -// Flags: --experimental-modules --experimental-loader ./test/fixtures/es-module-loaders/loader-unknown-builtin-module.mjs +// Flags: --experimental-loader ./test/fixtures/es-module-loaders/loader-unknown-builtin-module.mjs import { expectsError, mustCall } from '../common/index.mjs'; import assert from 'assert'; diff --git a/test/parallel/test-module-main-extension-lookup.js b/test/parallel/test-module-main-extension-lookup.js index 9e7eab295e..58d78e09b1 100644 --- a/test/parallel/test-module-main-extension-lookup.js +++ b/test/parallel/test-module-main-extension-lookup.js @@ -5,7 +5,5 @@ const { execFileSync } = require('child_process'); const node = process.argv[0]; -execFileSync(node, ['--experimental-modules', - fixtures.path('es-modules', 'test-esm-ok.mjs')]); -execFileSync(node, ['--experimental-modules', - fixtures.path('es-modules', 'noext')]); +execFileSync(node, [fixtures.path('es-modules', 'test-esm-ok.mjs')]); +execFileSync(node, [fixtures.path('es-modules', 'noext')]); diff --git a/test/parallel/test-module-main-fail.js b/test/parallel/test-module-main-fail.js index a6457f33b6..c66b6f2f7a 100644 --- a/test/parallel/test-module-main-fail.js +++ b/test/parallel/test-module-main-fail.js @@ -4,18 +4,15 @@ const assert = require('assert'); const { execFileSync } = require('child_process'); const entryPoints = ['iDoNotExist', 'iDoNotExist.js', 'iDoNotExist.mjs']; -const flags = [[], ['--experimental-modules']]; const node = process.argv[0]; -for (const args of flags) { - for (const entryPoint of entryPoints) { - try { - execFileSync(node, args.concat(entryPoint), { stdio: 'pipe' }); - } catch (e) { - assert(e.toString().match(/Error: Cannot find module/)); - continue; - } - assert.fail('Executing node with inexistent entry point should ' + - `fail. Entry point: ${entryPoint}, Flags: [${args}]`); +for (const entryPoint of entryPoints) { + try { + execFileSync(node, [entryPoint], { stdio: 'pipe' }); + } catch (e) { + assert(e.toString().match(/Error: Cannot find module/)); + continue; } + assert.fail('Executing node with inexistent entry point should ' + + `fail. Entry point: ${entryPoint}`); } diff --git a/test/parallel/test-module-main-preserve-symlinks-fail.js b/test/parallel/test-module-main-preserve-symlinks-fail.js index b46497b625..bbaf451c3c 100644 --- a/test/parallel/test-module-main-preserve-symlinks-fail.js +++ b/test/parallel/test-module-main-preserve-symlinks-fail.js @@ -4,7 +4,7 @@ const assert = require('assert'); const { execFileSync } = require('child_process'); const entryPoints = ['iDoNotExist', 'iDoNotExist.js', 'iDoNotExist.mjs']; -const flags = [[], ['--experimental-modules', '--preserve-symlinks']]; +const flags = [[], ['--preserve-symlinks']]; const node = process.argv[0]; for (const args of flags) { diff --git a/test/parallel/test-source-map.js b/test/parallel/test-source-map.js index 13fa391aaf..c14892890c 100644 --- a/test/parallel/test-source-map.js +++ b/test/parallel/test-source-map.js @@ -66,7 +66,6 @@ function nextdir() { const coverageDirectory = nextdir(); const output = spawnSync(process.execPath, [ '--no-warnings', - '--experimental-modules', require.resolve('../fixtures/source-map/esm-basic.mjs') ], { env: { ...process.env, NODE_V8_COVERAGE: coverageDirectory } }); assert.strictEqual(output.stderr.toString(), ''); @@ -217,7 +216,6 @@ function nextdir() { { const output = spawnSync(process.execPath, [ '--enable-source-maps', - '--experimental-modules', require.resolve('../fixtures/source-map/babel-esm.mjs') ]); assert.ok( diff --git a/test/parallel/test-vm-module-dynamic-import.js b/test/parallel/test-vm-module-dynamic-import.js index 897d9f27d7..70229b3897 100644 --- a/test/parallel/test-vm-module-dynamic-import.js +++ b/test/parallel/test-vm-module-dynamic-import.js @@ -1,6 +1,6 @@ 'use strict'; -// Flags: --experimental-vm-modules --experimental-modules +// Flags: --experimental-vm-modules const common = require('../common'); diff --git a/test/parallel/test-worker-esm-exit.js b/test/parallel/test-worker-esm-exit.js index c0b9d87489..1841069365 100644 --- a/test/parallel/test-worker-esm-exit.js +++ b/test/parallel/test-worker-esm-exit.js @@ -4,7 +4,6 @@ const fixtures = require('../common/fixtures'); const assert = require('assert'); const { Worker } = require('worker_threads'); -const w = new Worker(fixtures.path('es-modules/import-process-exit.mjs'), - { execArgv: ['--experimental-modules'] }); +const w = new Worker(fixtures.path('es-modules/import-process-exit.mjs')); w.on('error', common.mustNotCall()); w.on('exit', (code) => assert.strictEqual(code, 42)); diff --git a/test/parallel/test-worker-esm-missing-main.js b/test/parallel/test-worker-esm-missing-main.js index 8f4cfb0fe7..07bfb6a027 100644 --- a/test/parallel/test-worker-esm-missing-main.js +++ b/test/parallel/test-worker-esm-missing-main.js @@ -8,7 +8,7 @@ const tmpdir = require('../common/tmpdir'); tmpdir.refresh(); const missing = path.join(tmpdir.path, 'does-not-exist.js'); -const worker = new Worker(missing, { execArgv: ['--experimental-modules'] }); +const worker = new Worker(missing); worker.on('error', common.mustCall((err) => { // eslint-disable-next-line node-core/no-unescaped-regexp-dot diff --git a/test/parallel/test-worker-esmodule.js b/test/parallel/test-worker-esmodule.js index 33788c1422..e7f9bd7aea 100644 --- a/test/parallel/test-worker-esmodule.js +++ b/test/parallel/test-worker-esmodule.js @@ -1,4 +1,3 @@ -// Flags: --experimental-modules 'use strict'; const common = require('../common'); const fixtures = require('../common/fixtures'); diff --git a/test/parallel/test-worker-mjs-workerdata.js b/test/parallel/test-worker-mjs-workerdata.js index c107730ea4..b0a65e2e80 100644 --- a/test/parallel/test-worker-mjs-workerdata.js +++ b/test/parallel/test-worker-mjs-workerdata.js @@ -7,8 +7,7 @@ const { Worker } = require('worker_threads'); const workerData = 'Hello from main thread'; const worker = new Worker(fixtures.path('worker-data.mjs'), { - workerData, - execArgv: ['--experimental-modules'] + workerData }); worker.on('message', common.mustCall((message) => { |