From 9088867cc19262c1d5ab76b91a67eb9ad3a5bb03 Mon Sep 17 00:00:00 2001 From: Geoffrey Booth <456802+GeoffreyBooth@users.noreply.github.com> Date: Wed, 28 Sep 2022 00:01:44 -0700 Subject: [PATCH] esm: fix duplicated test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/44779 Reviewed-By: Antoine du Hamel Reviewed-By: Michaƫl Zasso --- .../test-esm-specifiers-legacy-flag.mjs | 21 ------------------- test/es-module/test-esm-specifiers.mjs | 7 +++++-- 2 files changed, 5 insertions(+), 23 deletions(-) delete mode 100644 test/es-module/test-esm-specifiers-legacy-flag.mjs diff --git a/test/es-module/test-esm-specifiers-legacy-flag.mjs b/test/es-module/test-esm-specifiers-legacy-flag.mjs deleted file mode 100644 index 5351846c6a8..00000000000 --- a/test/es-module/test-esm-specifiers-legacy-flag.mjs +++ /dev/null @@ -1,21 +0,0 @@ -// Flags: --es-module-specifier-resolution=node -import '../common/index.mjs'; -import assert from 'assert'; - -// commonJS index.js -import commonjs from '../fixtures/es-module-specifiers/package-type-commonjs'; -// esm index.js -import module from '../fixtures/es-module-specifiers/package-type-module'; -// Directory entry with main.js -import main from '../fixtures/es-module-specifiers/dir-with-main'; -// Notice the trailing slash -import success, { explicit, implicit, implicitModule } - from '../fixtures/es-module-specifiers/'; - -assert.strictEqual(commonjs, 'commonjs'); -assert.strictEqual(module, 'module'); -assert.strictEqual(main, 'main'); -assert.strictEqual(success, 'success'); -assert.strictEqual(explicit, 'esm'); -assert.strictEqual(implicit, 'cjs'); -assert.strictEqual(implicitModule, 'cjs'); diff --git a/test/es-module/test-esm-specifiers.mjs b/test/es-module/test-esm-specifiers.mjs index 670cd93c9b0..692db968141 100644 --- a/test/es-module/test-esm-specifiers.mjs +++ b/test/es-module/test-esm-specifiers.mjs @@ -14,14 +14,17 @@ describe('ESM: specifier-resolution=node', { concurrency: true }, () => { '--eval', [ 'import { strictEqual } from "node:assert";', - // commonJS index.js + // CommonJS index.js `import commonjs from ${JSON.stringify(fixtures.fileURL('es-module-specifiers/package-type-commonjs'))};`, - // esm index.js + // ESM index.js `import module from ${JSON.stringify(fixtures.fileURL('es-module-specifiers/package-type-module'))};`, + // Directory entry with main.js + `import main from ${JSON.stringify(fixtures.fileURL('es-module-specifiers/dir-with-main'))};`, // Notice the trailing slash `import success, { explicit, implicit, implicitModule } from ${JSON.stringify(fixtures.fileURL('es-module-specifiers/'))};`, 'strictEqual(commonjs, "commonjs");', 'strictEqual(module, "module");', + 'strictEqual(main, "main");', 'strictEqual(success, "success");', 'strictEqual(explicit, "esm");', 'strictEqual(implicit, "cjs");',