Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixup
  • Loading branch information
juanarbol committed Dec 1, 2019
commit 21813e384d10523a02345a053321fafa3b5e53b1
8 changes: 8 additions & 0 deletions test/es-module/test-esm-dynamic-import.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ function expectFsNamespace(result) {
// For direct use of import expressions inside of CJS or ES modules, including
// via eval, all kinds of specifiers should work without issue.
(function testScriptOrModuleImport() {
// Warning should be emitted 9 times, bellow we're importing 9 ES modules.
const IMPORTED_DYNAMICALLY = 9;
process.on('warning', common.mustCall(({ name, code, message }) => {
assert.strictEqual(code, undefined);
assert.strictEqual(message, 'The ESM module loader is experimental.');
assert.strictEqual(name, 'ExperimentalWarning');
}, IMPORTED_DYNAMICALLY));

// Importing another file, both direct & via eval
// expectOkNamespace(import(relativePath));
expectOkNamespace(eval(`import("${relativePath}")`));
Expand Down