summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorBradley Farias <bfarias@godaddy.com>2019-09-30 14:55:59 -0500
committerGuy Bedford <guybedford@gmail.com>2019-10-16 21:50:05 -0400
commita6b030d5ac2c4a2d34f6b9eb3f945d252a42843e (patch)
treedfd91dad91d60e90e39db3b5326d509c32a62f5f /test
parent1784b7fafac2755f870db3de9eb45a754b7a6477 (diff)
downloadandroid-node-v8-a6b030d5ac2c4a2d34f6b9eb3f945d252a42843e.tar.gz
android-node-v8-a6b030d5ac2c4a2d34f6b9eb3f945d252a42843e.tar.bz2
android-node-v8-a6b030d5ac2c4a2d34f6b9eb3f945d252a42843e.zip
module: refactor modules bootstrap
PR-URL: https://github.com/nodejs/node/pull/29937 Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/es-module/test-esm-loader-modulemap.js2
-rw-r--r--test/es-module/test-esm-no-extension.js7
-rw-r--r--test/parallel/test-bootstrap-modules.js1
-rw-r--r--test/parallel/test-internal-module-map-asserts.js8
4 files changed, 5 insertions, 13 deletions
diff --git a/test/es-module/test-esm-loader-modulemap.js b/test/es-module/test-esm-loader-modulemap.js
index 5493c6c47c..70f5a10159 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
+// Flags: --expose-internals --experimental-modules
// This test ensures that the type checking of ModuleMap throws
// errors appropriately
diff --git a/test/es-module/test-esm-no-extension.js b/test/es-module/test-esm-no-extension.js
index e3f30d6e3c..81b8e5b432 100644
--- a/test/es-module/test-esm-no-extension.js
+++ b/test/es-module/test-esm-no-extension.js
@@ -15,11 +15,6 @@ const child = spawn(process.execPath, [
entry
]);
-let stderr = '';
-child.stderr.setEncoding('utf8');
-child.stderr.on('data', (data) => {
- stderr += data;
-});
let stdout = '';
child.stdout.setEncoding('utf8');
child.stdout.on('data', (data) => {
@@ -29,6 +24,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/parallel/test-bootstrap-modules.js b/test/parallel/test-bootstrap-modules.js
index 939658a3b0..c963630f5d 100644
--- a/test/parallel/test-bootstrap-modules.js
+++ b/test/parallel/test-bootstrap-modules.js
@@ -92,7 +92,6 @@ if (common.isMainThread) {
expectedModules.add('NativeModule internal/streams/state');
expectedModules.add('NativeModule internal/worker');
expectedModules.add('NativeModule internal/worker/io');
- expectedModules.add('NativeModule module');
expectedModules.add('NativeModule stream');
expectedModules.add('NativeModule worker_threads');
}
diff --git a/test/parallel/test-internal-module-map-asserts.js b/test/parallel/test-internal-module-map-asserts.js
index 4563fc605e..614da43aba 100644
--- a/test/parallel/test-internal-module-map-asserts.js
+++ b/test/parallel/test-internal-module-map-asserts.js
@@ -12,7 +12,7 @@ const ModuleMap = require('internal/modules/esm/module_map');
code: 'ERR_INVALID_ARG_TYPE',
type: TypeError,
message: /^The "url" argument must be of type string/
- }, 15);
+ }, 12);
const moduleMap = new ModuleMap();
@@ -21,7 +21,7 @@ const ModuleMap = require('internal/modules/esm/module_map');
// but I think it's useless, and was not simple to mock...
const job = undefined;
- [{}, [], true, 1, () => {}].forEach((value) => {
+ [{}, [], true, 1].forEach((value) => {
assert.throws(() => moduleMap.get(value), errorReg);
assert.throws(() => moduleMap.has(value), errorReg);
assert.throws(() => moduleMap.set(value, job), errorReg);
@@ -34,11 +34,11 @@ const ModuleMap = require('internal/modules/esm/module_map');
code: 'ERR_INVALID_ARG_TYPE',
type: TypeError,
message: /^The "job" argument must be of type ModuleJob/
- }, 5);
+ }, 4);
const moduleMap = new ModuleMap();
- [{}, [], true, 1, () => {}].forEach((value) => {
+ [{}, [], true, 1].forEach((value) => {
assert.throws(() => moduleMap.set('', value), errorReg);
});
}