Skip to content

Commit

Permalink
Fix for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
GeoffreyBooth committed Oct 2, 2023
1 parent 5c4e93a commit 6f61ca0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions test/es-module/test-esm-type-flag-cli-entry.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -37,55 +37,55 @@ 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);
});

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);
});

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);
});

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);
});
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/es-modules/package-without-type/file#1.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log('file#1');
1 change: 0 additions & 1 deletion test/fixtures/es-modules/package-without-type/wha?.js

This file was deleted.

0 comments on commit 6f61ca0

Please sign in to comment.