summaryrefslogtreecommitdiff
path: root/test/es-module/test-cjs-esm-warn.js
diff options
context:
space:
mode:
authorGuy Bedford <guybedford@gmail.com>2019-10-11 17:57:13 -0400
committerMyles Borins <mylesborins@google.com>2019-11-12 14:04:55 -0800
commit796f3d0af49164314868c4778af90eca356f1fef (patch)
treef1b8d619df36917b03ba035630f389e1da305712 /test/es-module/test-cjs-esm-warn.js
parentcc6f99de449beb0993db3647de4ef979bead804d (diff)
downloadandroid-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/es-module/test-cjs-esm-warn.js')
-rw-r--r--test/es-module/test-cjs-esm-warn.js8
1 files changed, 5 insertions, 3 deletions
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);
}));