diff --git a/test/es-module/test-esm-type-flag-cli-entry.mjs b/test/es-module/test-esm-type-flag-cli-entry.mjs index 3e5e5a1efee117..002840751532ff 100644 --- a/test/es-module/test-esm-type-flag-cli-entry.mjs +++ b/test/es-module/test-esm-type-flag-cli-entry.mjs @@ -37,13 +37,13 @@ describe('--experimental-default-type=module should not parse paths as URLs', { it('should not parse a `?` in a filename as starting a query string', async () => { const { code, signal, stdout, stderr } = await spawnPromisified(process.execPath, [ '--experimental-default-type=module', - 'wha?.js', + 'file#1.js', ], { cwd: fixtures.path('es-modules/package-without-type'), }); strictEqual(stderr, ''); - strictEqual(stdout, 'wha?\n'); + strictEqual(stdout, 'file#1\n'); strictEqual(code, 0); strictEqual(signal, null); }); @@ -51,13 +51,13 @@ describe('--experimental-default-type=module should not parse paths as URLs', { it('should resolve `..`', async () => { const { code, signal, stdout, stderr } = await spawnPromisified(process.execPath, [ '--experimental-default-type=module', - '../package-without-type/wha?.js', + '../package-without-type/file#1.js', ], { cwd: fixtures.path('es-modules/package-without-type'), }); strictEqual(stderr, ''); - strictEqual(stdout, 'wha?\n'); + strictEqual(stdout, 'file#1\n'); strictEqual(code, 0); strictEqual(signal, null); }); @@ -65,13 +65,13 @@ describe('--experimental-default-type=module should not parse paths as URLs', { it('should allow a leading `./`', async () => { const { code, signal, stdout, stderr } = await spawnPromisified(process.execPath, [ '--experimental-default-type=module', - './wha?.js', + './file#1.js', ], { cwd: fixtures.path('es-modules/package-without-type'), }); strictEqual(stderr, ''); - strictEqual(stdout, 'wha?\n'); + strictEqual(stdout, 'file#1\n'); strictEqual(code, 0); strictEqual(signal, null); }); @@ -79,13 +79,13 @@ describe('--experimental-default-type=module should not parse paths as URLs', { it('should not require a leading `./`', async () => { const { code, signal, stdout, stderr } = await spawnPromisified(process.execPath, [ '--experimental-default-type=module', - 'wha?.js', + 'file#1.js', ], { cwd: fixtures.path('es-modules/package-without-type'), }); strictEqual(stderr, ''); - strictEqual(stdout, 'wha?\n'); + strictEqual(stdout, 'file#1\n'); strictEqual(code, 0); strictEqual(signal, null); }); diff --git a/test/fixtures/es-modules/package-without-type/file#1.js b/test/fixtures/es-modules/package-without-type/file#1.js new file mode 100644 index 00000000000000..6ab97dbf4b58cf --- /dev/null +++ b/test/fixtures/es-modules/package-without-type/file#1.js @@ -0,0 +1 @@ +console.log('file#1'); diff --git a/test/fixtures/es-modules/package-without-type/wha?.js b/test/fixtures/es-modules/package-without-type/wha?.js deleted file mode 100644 index df02872289e013..00000000000000 --- a/test/fixtures/es-modules/package-without-type/wha?.js +++ /dev/null @@ -1 +0,0 @@ -console.log('wha?');