From 369eacfd03a75227e88fe955308666190e45080c Mon Sep 17 00:00:00 2001 From: Hiroki Osame Date: Thu, 9 Feb 2023 08:19:38 +0900 Subject: [PATCH 1/6] wip --- src/index.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 2817d42..342fb87 100644 --- a/src/index.ts +++ b/src/index.ts @@ -179,7 +179,11 @@ function resolveTsFilename( ) { const tsPath = resolveTsPath(request); - if (parent && isTsFilePatten.test(parent.filename) && tsPath) { + if ( + parent + && fileMatcher?.(parent.filename) + && tsPath + ) { try { return resolveFilename.call( this, From 856bc92c8597c7e2e15e08a358942742244a877c Mon Sep 17 00:00:00 2001 From: Hiroki Osame Date: Mon, 28 Aug 2023 15:56:57 +0900 Subject: [PATCH 2/6] wip --- src/index.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 3a55b3a..86a0a79 100644 --- a/src/index.ts +++ b/src/index.ts @@ -17,7 +17,6 @@ import { import type { TransformOptions } from 'esbuild'; const isPathPattern = /^\.{0,2}\//; -const isTsFilePatten = /\.[cm]?tsx?$/; const nodeModulesPath = `${path.sep}node_modules${path.sep}`; const tsconfig = ( From cc698fbe097edc908ddca7b7888e834a0963a298 Mon Sep 17 00:00:00 2001 From: Hiroki Osame Date: Mon, 28 Aug 2023 18:22:09 +0900 Subject: [PATCH 3/6] wip --- package.json | 2 +- tests/index.ts | 11 +- tests/specs/javascript/cjs.ts | 315 ++++++++++++++++---------------- tests/specs/javascript/index.ts | 16 +- tests/utils/node-with-loader.ts | 6 +- 5 files changed, 178 insertions(+), 172 deletions(-) diff --git a/package.json b/package.json index e035a6a..ee07169 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "build": "pkgroll --target node12.20 --minify", "lint": "eslint .", "type-check": "tsc --noEmit", - "test": "pnpm build && tsx tests/index.ts", + "test": "tsx tests/index.ts", "prepack": "pnpm build && clean-pkg-json" }, "dependencies": { diff --git a/tests/index.ts b/tests/index.ts index a4b6d8d..2209dfd 100644 --- a/tests/index.ts +++ b/tests/index.ts @@ -3,7 +3,7 @@ import { createNode } from './utils/node-with-loader.js'; const nodeVersions = [ '12.16.2', // Pre ESM import - '12', + // '12', ...( process.env.CI ? [ @@ -20,15 +20,16 @@ const nodeVersions = [ for (const nodeVersion of nodeVersions) { const node = await createNode(nodeVersion, './tests/fixtures'); + console.log(node); await describe(`Node ${node.version}`, ({ runTestSuite }) => { runTestSuite( import('./specs/javascript/index.js'), node, ); - runTestSuite( - import('./specs/typescript/index.js'), - node, - ); + // runTestSuite( + // import('./specs/typescript/index.js'), + // node, + // ); }); } })(); diff --git a/tests/specs/javascript/cjs.ts b/tests/specs/javascript/cjs.ts index aac5fae..e315975 100644 --- a/tests/specs/javascript/cjs.ts +++ b/tests/specs/javascript/cjs.ts @@ -26,171 +26,172 @@ export default testSuite(async ({ describe }, node: NodeApis) => { test('Load', async () => { const nodeProcess = await node.load(importPath); + console.log(nodeProcess); assertResults(nodeProcess.stdout); }); - test('Import', async () => { - const nodeProcess = await node.importDynamic(importPath); - assertResults(nodeProcess.stdout); - expect(nodeProcess.stdout).toMatch('{"default":1234}'); - }); - - test('TypeScript Import', async () => { - const nodeProcess = await node.importDynamic(importPath, { mode: 'typescript' }); - assertResults(nodeProcess.stdout); - expect(nodeProcess.stdout).toMatch('{"default":1234}'); - }); - - test('Require', async () => { - const nodeProcess = await node.require(importPath); - assertResults(nodeProcess.stdout); - expect(nodeProcess.stdout).toMatch('1234'); - }); - }); - - describe('extensionless - shoud not work', ({ test }) => { - const importPath = './lib/cjs-ext-cjs/index'; + // test('Import', async () => { + // const nodeProcess = await node.importDynamic(importPath); + // assertResults(nodeProcess.stdout); + // expect(nodeProcess.stdout).toMatch('{"default":1234}'); + // }); - test('Load', async () => { - const nodeProcess = await node.load(importPath); - expect(nodeProcess.stderr).toMatch('Cannot find module'); - }); - - test('Import', async () => { - const nodeProcess = await node.importDynamic(importPath); - expect(nodeProcess.stderr).toMatch('Cannot find module'); - }); + // test('TypeScript Import', async () => { + // const nodeProcess = await node.importDynamic(importPath, { mode: 'typescript' }); + // assertResults(nodeProcess.stdout); + // expect(nodeProcess.stdout).toMatch('{"default":1234}'); + // }); - test('Require', async () => { - const nodeProcess = await node.require(importPath); - expect(nodeProcess.stderr).toMatch('Cannot find module'); - }); + // test('Require', async () => { + // const nodeProcess = await node.require(importPath); + // assertResults(nodeProcess.stdout); + // expect(nodeProcess.stdout).toMatch('1234'); + // }); }); - describe('directory - shoud not work', ({ test }) => { - const importPath = './lib/cjs-ext-cjs'; - - test('Load', async () => { - const nodeProcess = await node.load(importPath); - expect(nodeProcess.stderr).toMatch('Cannot find module'); - }); - - test('Import', async () => { - const nodeProcess = await node.importDynamic(importPath); - - if (semver.satisfies(node.version, nodeSupports.import)) { - expect(nodeProcess.stderr).toMatch('Directory import'); - } else { - expect(nodeProcess.stderr).toMatch('Cannot find module'); - } - }); - - test('Require', async () => { - const nodeProcess = await node.require(importPath); - expect(nodeProcess.stderr).toMatch('Cannot find module'); - }); - }); + // describe('extensionless - shoud not work', ({ test }) => { + // const importPath = './lib/cjs-ext-cjs/index'; + + // test('Load', async () => { + // const nodeProcess = await node.load(importPath); + // expect(nodeProcess.stderr).toMatch('Cannot find module'); + // }); + + // test('Import', async () => { + // const nodeProcess = await node.importDynamic(importPath); + // expect(nodeProcess.stderr).toMatch('Cannot find module'); + // }); + + // test('Require', async () => { + // const nodeProcess = await node.require(importPath); + // expect(nodeProcess.stderr).toMatch('Cannot find module'); + // }); + // }); + + // describe('directory - shoud not work', ({ test }) => { + // const importPath = './lib/cjs-ext-cjs'; + + // test('Load', async () => { + // const nodeProcess = await node.load(importPath); + // expect(nodeProcess.stderr).toMatch('Cannot find module'); + // }); + + // test('Import', async () => { + // const nodeProcess = await node.importDynamic(importPath); + + // if (semver.satisfies(node.version, nodeSupports.import)) { + // expect(nodeProcess.stderr).toMatch('Directory import'); + // } else { + // expect(nodeProcess.stderr).toMatch('Cannot find module'); + // } + // }); + + // test('Require', async () => { + // const nodeProcess = await node.require(importPath); + // expect(nodeProcess.stderr).toMatch('Cannot find module'); + // }); + // }); }); - describe('.js extension', ({ describe }) => { - function assertResults(stdout: string) { - expect(stdout).toMatch('loaded cjs-ext-js/index.js'); - expect(stdout).toMatch('✔ has CJS context'); - expect(stdout).toMatch('✔ name in error'); - expect(stdout).toMatch('✔ sourcemaps'); - expect(stdout).toMatch('✔ has dynamic import'); - expect(stdout).toMatch('✔ resolves optional node prefix'); - expect(stdout).toMatch('✔ preserves names'); - expect(stdout).toMatch( - semver.satisfies(node.version, nodeSupports.testRunner) - ? '✔ resolves required node prefix' - : '✖ resolves required node prefix: Error', - ); - } - - describe('full path', ({ test }) => { - const importPath = './lib/cjs-ext-js/index.js'; - - test('Load', async () => { - const nodeProcess = await node.load(importPath); - assertResults(nodeProcess.stdout); - }); - - test('Import', async () => { - const nodeProcess = await node.importDynamic(importPath); - assertResults(nodeProcess.stdout); - expect(nodeProcess.stdout).toMatch('{"default":1234}'); - }); - - test('Require', async () => { - const nodeProcess = await node.require(importPath); - assertResults(nodeProcess.stdout); - expect(nodeProcess.stdout).toMatch('1234'); - }); - }); - - describe('extensionless', ({ test }) => { - const importPath = './lib/cjs-ext-js/index'; - - test('Load', async () => { - const nodeProcess = await node.load(importPath); - assertResults(nodeProcess.stdout); - }); - - /** - * Dynamic import was introduced in Node v12.20+ and v13.2+ - * https://github.com/evanw/esbuild/blob/783527408b41bf55a6ac7ebb0b1ab4128a29417d/scripts/compat-table.js#L233 - * - * For Node.js versions that support import, the esm-loader - * should be used. - * - * Alternatively, we can set the target to Node 11 - * and transform the import to a require(). But - * this means other features will be transpiled. - */ - test('Import', async () => { - const nodeProcess = await node.importDynamic(importPath); - - if (semver.satisfies(node.version, nodeSupports.import)) { - expect(nodeProcess.stderr).toMatch('Cannot find module'); - } else { - assertResults(nodeProcess.stdout); - expect(nodeProcess.stdout).toMatch('{"default":1234}'); - } - }); - - test('Require', async () => { - const nodeProcess = await node.require(importPath); - assertResults(nodeProcess.stdout); - expect(nodeProcess.stdout).toMatch('1234'); - }); - }); - - describe('directory', ({ test }) => { - const importPath = './lib/cjs-ext-js'; - - test('Load', async () => { - const nodeProcess = await node.load(importPath); - assertResults(nodeProcess.stdout); - }); - - test('Import', async () => { - const nodeProcess = await node.importDynamic(importPath); - - if (semver.satisfies(node.version, nodeSupports.import)) { - expect(nodeProcess.stderr).toMatch('Directory import'); - } else { - assertResults(nodeProcess.stdout); - expect(nodeProcess.stdout).toMatch('{"default":1234}'); - } - }); - - test('Require', async () => { - const nodeProcess = await node.require(importPath); - assertResults(nodeProcess.stdout); - expect(nodeProcess.stdout).toMatch('1234'); - }); - }); - }); + // describe('.js extension', ({ describe }) => { + // function assertResults(stdout: string) { + // expect(stdout).toMatch('loaded cjs-ext-js/index.js'); + // expect(stdout).toMatch('✔ has CJS context'); + // expect(stdout).toMatch('✔ name in error'); + // expect(stdout).toMatch('✔ sourcemaps'); + // expect(stdout).toMatch('✔ has dynamic import'); + // expect(stdout).toMatch('✔ resolves optional node prefix'); + // expect(stdout).toMatch('✔ preserves names'); + // expect(stdout).toMatch( + // semver.satisfies(node.version, nodeSupports.testRunner) + // ? '✔ resolves required node prefix' + // : '✖ resolves required node prefix: Error', + // ); + // } + + // describe('full path', ({ test }) => { + // const importPath = './lib/cjs-ext-js/index.js'; + + // test('Load', async () => { + // const nodeProcess = await node.load(importPath); + // assertResults(nodeProcess.stdout); + // }); + + // test('Import', async () => { + // const nodeProcess = await node.importDynamic(importPath); + // assertResults(nodeProcess.stdout); + // expect(nodeProcess.stdout).toMatch('{"default":1234}'); + // }); + + // test('Require', async () => { + // const nodeProcess = await node.require(importPath); + // assertResults(nodeProcess.stdout); + // expect(nodeProcess.stdout).toMatch('1234'); + // }); + // }); + + // describe('extensionless', ({ test }) => { + // const importPath = './lib/cjs-ext-js/index'; + + // test('Load', async () => { + // const nodeProcess = await node.load(importPath); + // assertResults(nodeProcess.stdout); + // }); + + // /** + // * Dynamic import was introduced in Node v12.20+ and v13.2+ + // * https://github.com/evanw/esbuild/blob/783527408b41bf55a6ac7ebb0b1ab4128a29417d/scripts/compat-table.js#L233 + // * + // * For Node.js versions that support import, the esm-loader + // * should be used. + // * + // * Alternatively, we can set the target to Node 11 + // * and transform the import to a require(). But + // * this means other features will be transpiled. + // */ + // test('Import', async () => { + // const nodeProcess = await node.importDynamic(importPath); + + // if (semver.satisfies(node.version, nodeSupports.import)) { + // expect(nodeProcess.stderr).toMatch('Cannot find module'); + // } else { + // assertResults(nodeProcess.stdout); + // expect(nodeProcess.stdout).toMatch('{"default":1234}'); + // } + // }); + + // test('Require', async () => { + // const nodeProcess = await node.require(importPath); + // assertResults(nodeProcess.stdout); + // expect(nodeProcess.stdout).toMatch('1234'); + // }); + // }); + + // describe('directory', ({ test }) => { + // const importPath = './lib/cjs-ext-js'; + + // test('Load', async () => { + // const nodeProcess = await node.load(importPath); + // assertResults(nodeProcess.stdout); + // }); + + // test('Import', async () => { + // const nodeProcess = await node.importDynamic(importPath); + + // if (semver.satisfies(node.version, nodeSupports.import)) { + // expect(nodeProcess.stderr).toMatch('Directory import'); + // } else { + // assertResults(nodeProcess.stdout); + // expect(nodeProcess.stdout).toMatch('{"default":1234}'); + // } + // }); + + // test('Require', async () => { + // const nodeProcess = await node.require(importPath); + // assertResults(nodeProcess.stdout); + // expect(nodeProcess.stdout).toMatch('1234'); + // }); + // }); + // }); }); }); diff --git a/tests/specs/javascript/index.ts b/tests/specs/javascript/index.ts index 5583671..6084fce 100644 --- a/tests/specs/javascript/index.ts +++ b/tests/specs/javascript/index.ts @@ -7,13 +7,13 @@ export default testSuite(async ({ describe }, node: NodeApis) => { import('./cjs.js'), node, ); - runTestSuite( - import('./esm.js'), - node, - ); - runTestSuite( - import('./dependencies.js'), - node, - ); + // runTestSuite( + // import('./esm.js'), + // node, + // ); + // runTestSuite( + // import('./dependencies.js'), + // node, + // ); }); }); diff --git a/tests/utils/node-with-loader.ts b/tests/utils/node-with-loader.ts index 0b4715a..4e5dfdd 100644 --- a/tests/utils/node-with-loader.ts +++ b/tests/utils/node-with-loader.ts @@ -41,7 +41,11 @@ export async function createNode( nodeVersion: string, fixturePath: string, ) { - const node = await getNode(nodeVersion); + const node = await getNode(nodeVersion, { + arch: 'x64', + }); + + console.log('downloaded', node); return { version: node.version, From b58c75a4c7f34361ffe4ce7ffbfcd2012da01c55 Mon Sep 17 00:00:00 2001 From: Hiroki Osame Date: Mon, 28 Aug 2023 21:21:05 +0900 Subject: [PATCH 4/6] wip --- .github/workflows/test.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b4a4cbf..a65d29c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,5 +37,8 @@ jobs: if: ${{ matrix.os == 'ubuntu-latest' }} run: pnpm type-check + - name: Build + run: pnpm build + - name: Test run: pnpm test From 407b1c2ff24317451c3f8ff6451a9134c3b9b269 Mon Sep 17 00:00:00 2001 From: Hiroki Osame Date: Mon, 28 Aug 2023 21:32:43 +0900 Subject: [PATCH 5/6] wip --- package.json | 2 +- pnpm-lock.yaml | 232 +------------------------------------------------ 2 files changed, 3 insertions(+), 231 deletions(-) diff --git a/package.json b/package.json index 03904e8..69cdc28 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "@types/semver": "^7.5.0", "@types/source-map-support": "^0.5.7", "clean-pkg-json": "^1.2.0", - "esbuild": "^0.19.2", + "esbuild": "~0.18.20", "eslint": "^8.48.0", "execa": "^8.0.1", "fs-fixture": "^1.2.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ce6fff4..052c735 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -29,8 +29,8 @@ devDependencies: specifier: ^1.2.0 version: 1.2.0 esbuild: - specifier: ^0.19.2 - version: 0.19.2 + specifier: ~0.18.20 + version: 0.18.20 eslint: specifier: ^8.48.0 version: 8.48.0 @@ -119,15 +119,6 @@ packages: requiresBuild: true optional: true - /@esbuild/android-arm64@0.19.2: - resolution: {integrity: sha512-lsB65vAbe90I/Qe10OjkmrdxSX4UJDjosDgb8sZUKcg3oefEuW2OT2Vozz8ef7wrJbMcmhvCC+hciF8jY/uAkw==} - engines: {node: '>=12'} - cpu: [arm64] - os: [android] - requiresBuild: true - dev: true - optional: true - /@esbuild/android-arm@0.18.20: resolution: {integrity: sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==} engines: {node: '>=12'} @@ -136,15 +127,6 @@ packages: requiresBuild: true optional: true - /@esbuild/android-arm@0.19.2: - resolution: {integrity: sha512-tM8yLeYVe7pRyAu9VMi/Q7aunpLwD139EY1S99xbQkT4/q2qa6eA4ige/WJQYdJ8GBL1K33pPFhPfPdJ/WzT8Q==} - engines: {node: '>=12'} - cpu: [arm] - os: [android] - requiresBuild: true - dev: true - optional: true - /@esbuild/android-x64@0.18.20: resolution: {integrity: sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==} engines: {node: '>=12'} @@ -153,15 +135,6 @@ packages: requiresBuild: true optional: true - /@esbuild/android-x64@0.19.2: - resolution: {integrity: sha512-qK/TpmHt2M/Hg82WXHRc/W/2SGo/l1thtDHZWqFq7oi24AjZ4O/CpPSu6ZuYKFkEgmZlFoa7CooAyYmuvnaG8w==} - engines: {node: '>=12'} - cpu: [x64] - os: [android] - requiresBuild: true - dev: true - optional: true - /@esbuild/darwin-arm64@0.18.20: resolution: {integrity: sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==} engines: {node: '>=12'} @@ -170,15 +143,6 @@ packages: requiresBuild: true optional: true - /@esbuild/darwin-arm64@0.19.2: - resolution: {integrity: sha512-Ora8JokrvrzEPEpZO18ZYXkH4asCdc1DLdcVy8TGf5eWtPO1Ie4WroEJzwI52ZGtpODy3+m0a2yEX9l+KUn0tA==} - engines: {node: '>=12'} - cpu: [arm64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - /@esbuild/darwin-x64@0.18.20: resolution: {integrity: sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==} engines: {node: '>=12'} @@ -187,15 +151,6 @@ packages: requiresBuild: true optional: true - /@esbuild/darwin-x64@0.19.2: - resolution: {integrity: sha512-tP+B5UuIbbFMj2hQaUr6EALlHOIOmlLM2FK7jeFBobPy2ERdohI4Ka6ZFjZ1ZYsrHE/hZimGuU90jusRE0pwDw==} - engines: {node: '>=12'} - cpu: [x64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - /@esbuild/freebsd-arm64@0.18.20: resolution: {integrity: sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==} engines: {node: '>=12'} @@ -204,15 +159,6 @@ packages: requiresBuild: true optional: true - /@esbuild/freebsd-arm64@0.19.2: - resolution: {integrity: sha512-YbPY2kc0acfzL1VPVK6EnAlig4f+l8xmq36OZkU0jzBVHcOTyQDhnKQaLzZudNJQyymd9OqQezeaBgkTGdTGeQ==} - engines: {node: '>=12'} - cpu: [arm64] - os: [freebsd] - requiresBuild: true - dev: true - optional: true - /@esbuild/freebsd-x64@0.18.20: resolution: {integrity: sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==} engines: {node: '>=12'} @@ -221,15 +167,6 @@ packages: requiresBuild: true optional: true - /@esbuild/freebsd-x64@0.19.2: - resolution: {integrity: sha512-nSO5uZT2clM6hosjWHAsS15hLrwCvIWx+b2e3lZ3MwbYSaXwvfO528OF+dLjas1g3bZonciivI8qKR/Hm7IWGw==} - engines: {node: '>=12'} - cpu: [x64] - os: [freebsd] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-arm64@0.18.20: resolution: {integrity: sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==} engines: {node: '>=12'} @@ -238,15 +175,6 @@ packages: requiresBuild: true optional: true - /@esbuild/linux-arm64@0.19.2: - resolution: {integrity: sha512-ig2P7GeG//zWlU0AggA3pV1h5gdix0MA3wgB+NsnBXViwiGgY77fuN9Wr5uoCrs2YzaYfogXgsWZbm+HGr09xg==} - engines: {node: '>=12'} - cpu: [arm64] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-arm@0.18.20: resolution: {integrity: sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==} engines: {node: '>=12'} @@ -255,15 +183,6 @@ packages: requiresBuild: true optional: true - /@esbuild/linux-arm@0.19.2: - resolution: {integrity: sha512-Odalh8hICg7SOD7XCj0YLpYCEc+6mkoq63UnExDCiRA2wXEmGlK5JVrW50vZR9Qz4qkvqnHcpH+OFEggO3PgTg==} - engines: {node: '>=12'} - cpu: [arm] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-ia32@0.18.20: resolution: {integrity: sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==} engines: {node: '>=12'} @@ -272,15 +191,6 @@ packages: requiresBuild: true optional: true - /@esbuild/linux-ia32@0.19.2: - resolution: {integrity: sha512-mLfp0ziRPOLSTek0Gd9T5B8AtzKAkoZE70fneiiyPlSnUKKI4lp+mGEnQXcQEHLJAcIYDPSyBvsUbKUG2ri/XQ==} - engines: {node: '>=12'} - cpu: [ia32] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-loong64@0.18.20: resolution: {integrity: sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==} engines: {node: '>=12'} @@ -289,15 +199,6 @@ packages: requiresBuild: true optional: true - /@esbuild/linux-loong64@0.19.2: - resolution: {integrity: sha512-hn28+JNDTxxCpnYjdDYVMNTR3SKavyLlCHHkufHV91fkewpIyQchS1d8wSbmXhs1fiYDpNww8KTFlJ1dHsxeSw==} - engines: {node: '>=12'} - cpu: [loong64] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-mips64el@0.18.20: resolution: {integrity: sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==} engines: {node: '>=12'} @@ -306,15 +207,6 @@ packages: requiresBuild: true optional: true - /@esbuild/linux-mips64el@0.19.2: - resolution: {integrity: sha512-KbXaC0Sejt7vD2fEgPoIKb6nxkfYW9OmFUK9XQE4//PvGIxNIfPk1NmlHmMg6f25x57rpmEFrn1OotASYIAaTg==} - engines: {node: '>=12'} - cpu: [mips64el] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-ppc64@0.18.20: resolution: {integrity: sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==} engines: {node: '>=12'} @@ -323,15 +215,6 @@ packages: requiresBuild: true optional: true - /@esbuild/linux-ppc64@0.19.2: - resolution: {integrity: sha512-dJ0kE8KTqbiHtA3Fc/zn7lCd7pqVr4JcT0JqOnbj4LLzYnp+7h8Qi4yjfq42ZlHfhOCM42rBh0EwHYLL6LEzcw==} - engines: {node: '>=12'} - cpu: [ppc64] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-riscv64@0.18.20: resolution: {integrity: sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==} engines: {node: '>=12'} @@ -340,15 +223,6 @@ packages: requiresBuild: true optional: true - /@esbuild/linux-riscv64@0.19.2: - resolution: {integrity: sha512-7Z/jKNFufZ/bbu4INqqCN6DDlrmOTmdw6D0gH+6Y7auok2r02Ur661qPuXidPOJ+FSgbEeQnnAGgsVynfLuOEw==} - engines: {node: '>=12'} - cpu: [riscv64] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-s390x@0.18.20: resolution: {integrity: sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==} engines: {node: '>=12'} @@ -357,15 +231,6 @@ packages: requiresBuild: true optional: true - /@esbuild/linux-s390x@0.19.2: - resolution: {integrity: sha512-U+RinR6aXXABFCcAY4gSlv4CL1oOVvSSCdseQmGO66H+XyuQGZIUdhG56SZaDJQcLmrSfRmx5XZOWyCJPRqS7g==} - engines: {node: '>=12'} - cpu: [s390x] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-x64@0.18.20: resolution: {integrity: sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==} engines: {node: '>=12'} @@ -374,15 +239,6 @@ packages: requiresBuild: true optional: true - /@esbuild/linux-x64@0.19.2: - resolution: {integrity: sha512-oxzHTEv6VPm3XXNaHPyUTTte+3wGv7qVQtqaZCrgstI16gCuhNOtBXLEBkBREP57YTd68P0VgDgG73jSD8bwXQ==} - engines: {node: '>=12'} - cpu: [x64] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/netbsd-x64@0.18.20: resolution: {integrity: sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==} engines: {node: '>=12'} @@ -391,15 +247,6 @@ packages: requiresBuild: true optional: true - /@esbuild/netbsd-x64@0.19.2: - resolution: {integrity: sha512-WNa5zZk1XpTTwMDompZmvQLHszDDDN7lYjEHCUmAGB83Bgs20EMs7ICD+oKeT6xt4phV4NDdSi/8OfjPbSbZfQ==} - engines: {node: '>=12'} - cpu: [x64] - os: [netbsd] - requiresBuild: true - dev: true - optional: true - /@esbuild/openbsd-x64@0.18.20: resolution: {integrity: sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==} engines: {node: '>=12'} @@ -408,15 +255,6 @@ packages: requiresBuild: true optional: true - /@esbuild/openbsd-x64@0.19.2: - resolution: {integrity: sha512-S6kI1aT3S++Dedb7vxIuUOb3oAxqxk2Rh5rOXOTYnzN8JzW1VzBd+IqPiSpgitu45042SYD3HCoEyhLKQcDFDw==} - engines: {node: '>=12'} - cpu: [x64] - os: [openbsd] - requiresBuild: true - dev: true - optional: true - /@esbuild/sunos-x64@0.18.20: resolution: {integrity: sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==} engines: {node: '>=12'} @@ -425,15 +263,6 @@ packages: requiresBuild: true optional: true - /@esbuild/sunos-x64@0.19.2: - resolution: {integrity: sha512-VXSSMsmb+Z8LbsQGcBMiM+fYObDNRm8p7tkUDMPG/g4fhFX5DEFmjxIEa3N8Zr96SjsJ1woAhF0DUnS3MF3ARw==} - engines: {node: '>=12'} - cpu: [x64] - os: [sunos] - requiresBuild: true - dev: true - optional: true - /@esbuild/win32-arm64@0.18.20: resolution: {integrity: sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==} engines: {node: '>=12'} @@ -442,15 +271,6 @@ packages: requiresBuild: true optional: true - /@esbuild/win32-arm64@0.19.2: - resolution: {integrity: sha512-5NayUlSAyb5PQYFAU9x3bHdsqB88RC3aM9lKDAz4X1mo/EchMIT1Q+pSeBXNgkfNmRecLXA0O8xP+x8V+g/LKg==} - engines: {node: '>=12'} - cpu: [arm64] - os: [win32] - requiresBuild: true - dev: true - optional: true - /@esbuild/win32-ia32@0.18.20: resolution: {integrity: sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==} engines: {node: '>=12'} @@ -459,15 +279,6 @@ packages: requiresBuild: true optional: true - /@esbuild/win32-ia32@0.19.2: - resolution: {integrity: sha512-47gL/ek1v36iN0wL9L4Q2MFdujR0poLZMJwhO2/N3gA89jgHp4MR8DKCmwYtGNksbfJb9JoTtbkoe6sDhg2QTA==} - engines: {node: '>=12'} - cpu: [ia32] - os: [win32] - requiresBuild: true - dev: true - optional: true - /@esbuild/win32-x64@0.18.20: resolution: {integrity: sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==} engines: {node: '>=12'} @@ -476,15 +287,6 @@ packages: requiresBuild: true optional: true - /@esbuild/win32-x64@0.19.2: - resolution: {integrity: sha512-tcuhV7ncXBqbt/Ybf0IyrMcwVOAPDckMK9rXNHtF17UTK18OKLpg08glminN06pt2WCoALhXdLfSPbVvK/6fxw==} - engines: {node: '>=12'} - cpu: [x64] - os: [win32] - requiresBuild: true - dev: true - optional: true - /@eslint-community/eslint-utils@4.4.0(eslint@8.48.0): resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -1528,36 +1330,6 @@ packages: '@esbuild/win32-ia32': 0.18.20 '@esbuild/win32-x64': 0.18.20 - /esbuild@0.19.2: - resolution: {integrity: sha512-G6hPax8UbFakEj3hWO0Vs52LQ8k3lnBhxZWomUJDxfz3rZTLqF5k/FCzuNdLx2RbpBiQQF9H9onlDDH1lZsnjg==} - engines: {node: '>=12'} - hasBin: true - requiresBuild: true - optionalDependencies: - '@esbuild/android-arm': 0.19.2 - '@esbuild/android-arm64': 0.19.2 - '@esbuild/android-x64': 0.19.2 - '@esbuild/darwin-arm64': 0.19.2 - '@esbuild/darwin-x64': 0.19.2 - '@esbuild/freebsd-arm64': 0.19.2 - '@esbuild/freebsd-x64': 0.19.2 - '@esbuild/linux-arm': 0.19.2 - '@esbuild/linux-arm64': 0.19.2 - '@esbuild/linux-ia32': 0.19.2 - '@esbuild/linux-loong64': 0.19.2 - '@esbuild/linux-mips64el': 0.19.2 - '@esbuild/linux-ppc64': 0.19.2 - '@esbuild/linux-riscv64': 0.19.2 - '@esbuild/linux-s390x': 0.19.2 - '@esbuild/linux-x64': 0.19.2 - '@esbuild/netbsd-x64': 0.19.2 - '@esbuild/openbsd-x64': 0.19.2 - '@esbuild/sunos-x64': 0.19.2 - '@esbuild/win32-arm64': 0.19.2 - '@esbuild/win32-ia32': 0.19.2 - '@esbuild/win32-x64': 0.19.2 - dev: true - /escape-string-regexp@1.0.5: resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==} engines: {node: '>=0.8.0'} From d6472cfdf90ddd6817bb50cdd2551545a9a5d9a6 Mon Sep 17 00:00:00 2001 From: Hiroki Osame Date: Mon, 28 Aug 2023 21:37:18 +0900 Subject: [PATCH 6/6] wip --- tests/index.ts | 11 +- tests/specs/javascript/cjs.ts | 315 ++++++++++++++++---------------- tests/specs/javascript/index.ts | 16 +- tests/utils/node-with-loader.ts | 2 - 4 files changed, 170 insertions(+), 174 deletions(-) diff --git a/tests/index.ts b/tests/index.ts index 2209dfd..a4b6d8d 100644 --- a/tests/index.ts +++ b/tests/index.ts @@ -3,7 +3,7 @@ import { createNode } from './utils/node-with-loader.js'; const nodeVersions = [ '12.16.2', // Pre ESM import - // '12', + '12', ...( process.env.CI ? [ @@ -20,16 +20,15 @@ const nodeVersions = [ for (const nodeVersion of nodeVersions) { const node = await createNode(nodeVersion, './tests/fixtures'); - console.log(node); await describe(`Node ${node.version}`, ({ runTestSuite }) => { runTestSuite( import('./specs/javascript/index.js'), node, ); - // runTestSuite( - // import('./specs/typescript/index.js'), - // node, - // ); + runTestSuite( + import('./specs/typescript/index.js'), + node, + ); }); } })(); diff --git a/tests/specs/javascript/cjs.ts b/tests/specs/javascript/cjs.ts index e315975..aac5fae 100644 --- a/tests/specs/javascript/cjs.ts +++ b/tests/specs/javascript/cjs.ts @@ -26,172 +26,171 @@ export default testSuite(async ({ describe }, node: NodeApis) => { test('Load', async () => { const nodeProcess = await node.load(importPath); - console.log(nodeProcess); assertResults(nodeProcess.stdout); }); - // test('Import', async () => { - // const nodeProcess = await node.importDynamic(importPath); - // assertResults(nodeProcess.stdout); - // expect(nodeProcess.stdout).toMatch('{"default":1234}'); - // }); + test('Import', async () => { + const nodeProcess = await node.importDynamic(importPath); + assertResults(nodeProcess.stdout); + expect(nodeProcess.stdout).toMatch('{"default":1234}'); + }); + + test('TypeScript Import', async () => { + const nodeProcess = await node.importDynamic(importPath, { mode: 'typescript' }); + assertResults(nodeProcess.stdout); + expect(nodeProcess.stdout).toMatch('{"default":1234}'); + }); + + test('Require', async () => { + const nodeProcess = await node.require(importPath); + assertResults(nodeProcess.stdout); + expect(nodeProcess.stdout).toMatch('1234'); + }); + }); + + describe('extensionless - shoud not work', ({ test }) => { + const importPath = './lib/cjs-ext-cjs/index'; - // test('TypeScript Import', async () => { - // const nodeProcess = await node.importDynamic(importPath, { mode: 'typescript' }); - // assertResults(nodeProcess.stdout); - // expect(nodeProcess.stdout).toMatch('{"default":1234}'); - // }); + test('Load', async () => { + const nodeProcess = await node.load(importPath); + expect(nodeProcess.stderr).toMatch('Cannot find module'); + }); + + test('Import', async () => { + const nodeProcess = await node.importDynamic(importPath); + expect(nodeProcess.stderr).toMatch('Cannot find module'); + }); - // test('Require', async () => { - // const nodeProcess = await node.require(importPath); - // assertResults(nodeProcess.stdout); - // expect(nodeProcess.stdout).toMatch('1234'); - // }); + test('Require', async () => { + const nodeProcess = await node.require(importPath); + expect(nodeProcess.stderr).toMatch('Cannot find module'); + }); }); - // describe('extensionless - shoud not work', ({ test }) => { - // const importPath = './lib/cjs-ext-cjs/index'; - - // test('Load', async () => { - // const nodeProcess = await node.load(importPath); - // expect(nodeProcess.stderr).toMatch('Cannot find module'); - // }); - - // test('Import', async () => { - // const nodeProcess = await node.importDynamic(importPath); - // expect(nodeProcess.stderr).toMatch('Cannot find module'); - // }); - - // test('Require', async () => { - // const nodeProcess = await node.require(importPath); - // expect(nodeProcess.stderr).toMatch('Cannot find module'); - // }); - // }); - - // describe('directory - shoud not work', ({ test }) => { - // const importPath = './lib/cjs-ext-cjs'; - - // test('Load', async () => { - // const nodeProcess = await node.load(importPath); - // expect(nodeProcess.stderr).toMatch('Cannot find module'); - // }); - - // test('Import', async () => { - // const nodeProcess = await node.importDynamic(importPath); - - // if (semver.satisfies(node.version, nodeSupports.import)) { - // expect(nodeProcess.stderr).toMatch('Directory import'); - // } else { - // expect(nodeProcess.stderr).toMatch('Cannot find module'); - // } - // }); - - // test('Require', async () => { - // const nodeProcess = await node.require(importPath); - // expect(nodeProcess.stderr).toMatch('Cannot find module'); - // }); - // }); + describe('directory - shoud not work', ({ test }) => { + const importPath = './lib/cjs-ext-cjs'; + + test('Load', async () => { + const nodeProcess = await node.load(importPath); + expect(nodeProcess.stderr).toMatch('Cannot find module'); + }); + + test('Import', async () => { + const nodeProcess = await node.importDynamic(importPath); + + if (semver.satisfies(node.version, nodeSupports.import)) { + expect(nodeProcess.stderr).toMatch('Directory import'); + } else { + expect(nodeProcess.stderr).toMatch('Cannot find module'); + } + }); + + test('Require', async () => { + const nodeProcess = await node.require(importPath); + expect(nodeProcess.stderr).toMatch('Cannot find module'); + }); + }); }); - // describe('.js extension', ({ describe }) => { - // function assertResults(stdout: string) { - // expect(stdout).toMatch('loaded cjs-ext-js/index.js'); - // expect(stdout).toMatch('✔ has CJS context'); - // expect(stdout).toMatch('✔ name in error'); - // expect(stdout).toMatch('✔ sourcemaps'); - // expect(stdout).toMatch('✔ has dynamic import'); - // expect(stdout).toMatch('✔ resolves optional node prefix'); - // expect(stdout).toMatch('✔ preserves names'); - // expect(stdout).toMatch( - // semver.satisfies(node.version, nodeSupports.testRunner) - // ? '✔ resolves required node prefix' - // : '✖ resolves required node prefix: Error', - // ); - // } - - // describe('full path', ({ test }) => { - // const importPath = './lib/cjs-ext-js/index.js'; - - // test('Load', async () => { - // const nodeProcess = await node.load(importPath); - // assertResults(nodeProcess.stdout); - // }); - - // test('Import', async () => { - // const nodeProcess = await node.importDynamic(importPath); - // assertResults(nodeProcess.stdout); - // expect(nodeProcess.stdout).toMatch('{"default":1234}'); - // }); - - // test('Require', async () => { - // const nodeProcess = await node.require(importPath); - // assertResults(nodeProcess.stdout); - // expect(nodeProcess.stdout).toMatch('1234'); - // }); - // }); - - // describe('extensionless', ({ test }) => { - // const importPath = './lib/cjs-ext-js/index'; - - // test('Load', async () => { - // const nodeProcess = await node.load(importPath); - // assertResults(nodeProcess.stdout); - // }); - - // /** - // * Dynamic import was introduced in Node v12.20+ and v13.2+ - // * https://github.com/evanw/esbuild/blob/783527408b41bf55a6ac7ebb0b1ab4128a29417d/scripts/compat-table.js#L233 - // * - // * For Node.js versions that support import, the esm-loader - // * should be used. - // * - // * Alternatively, we can set the target to Node 11 - // * and transform the import to a require(). But - // * this means other features will be transpiled. - // */ - // test('Import', async () => { - // const nodeProcess = await node.importDynamic(importPath); - - // if (semver.satisfies(node.version, nodeSupports.import)) { - // expect(nodeProcess.stderr).toMatch('Cannot find module'); - // } else { - // assertResults(nodeProcess.stdout); - // expect(nodeProcess.stdout).toMatch('{"default":1234}'); - // } - // }); - - // test('Require', async () => { - // const nodeProcess = await node.require(importPath); - // assertResults(nodeProcess.stdout); - // expect(nodeProcess.stdout).toMatch('1234'); - // }); - // }); - - // describe('directory', ({ test }) => { - // const importPath = './lib/cjs-ext-js'; - - // test('Load', async () => { - // const nodeProcess = await node.load(importPath); - // assertResults(nodeProcess.stdout); - // }); - - // test('Import', async () => { - // const nodeProcess = await node.importDynamic(importPath); - - // if (semver.satisfies(node.version, nodeSupports.import)) { - // expect(nodeProcess.stderr).toMatch('Directory import'); - // } else { - // assertResults(nodeProcess.stdout); - // expect(nodeProcess.stdout).toMatch('{"default":1234}'); - // } - // }); - - // test('Require', async () => { - // const nodeProcess = await node.require(importPath); - // assertResults(nodeProcess.stdout); - // expect(nodeProcess.stdout).toMatch('1234'); - // }); - // }); - // }); + describe('.js extension', ({ describe }) => { + function assertResults(stdout: string) { + expect(stdout).toMatch('loaded cjs-ext-js/index.js'); + expect(stdout).toMatch('✔ has CJS context'); + expect(stdout).toMatch('✔ name in error'); + expect(stdout).toMatch('✔ sourcemaps'); + expect(stdout).toMatch('✔ has dynamic import'); + expect(stdout).toMatch('✔ resolves optional node prefix'); + expect(stdout).toMatch('✔ preserves names'); + expect(stdout).toMatch( + semver.satisfies(node.version, nodeSupports.testRunner) + ? '✔ resolves required node prefix' + : '✖ resolves required node prefix: Error', + ); + } + + describe('full path', ({ test }) => { + const importPath = './lib/cjs-ext-js/index.js'; + + test('Load', async () => { + const nodeProcess = await node.load(importPath); + assertResults(nodeProcess.stdout); + }); + + test('Import', async () => { + const nodeProcess = await node.importDynamic(importPath); + assertResults(nodeProcess.stdout); + expect(nodeProcess.stdout).toMatch('{"default":1234}'); + }); + + test('Require', async () => { + const nodeProcess = await node.require(importPath); + assertResults(nodeProcess.stdout); + expect(nodeProcess.stdout).toMatch('1234'); + }); + }); + + describe('extensionless', ({ test }) => { + const importPath = './lib/cjs-ext-js/index'; + + test('Load', async () => { + const nodeProcess = await node.load(importPath); + assertResults(nodeProcess.stdout); + }); + + /** + * Dynamic import was introduced in Node v12.20+ and v13.2+ + * https://github.com/evanw/esbuild/blob/783527408b41bf55a6ac7ebb0b1ab4128a29417d/scripts/compat-table.js#L233 + * + * For Node.js versions that support import, the esm-loader + * should be used. + * + * Alternatively, we can set the target to Node 11 + * and transform the import to a require(). But + * this means other features will be transpiled. + */ + test('Import', async () => { + const nodeProcess = await node.importDynamic(importPath); + + if (semver.satisfies(node.version, nodeSupports.import)) { + expect(nodeProcess.stderr).toMatch('Cannot find module'); + } else { + assertResults(nodeProcess.stdout); + expect(nodeProcess.stdout).toMatch('{"default":1234}'); + } + }); + + test('Require', async () => { + const nodeProcess = await node.require(importPath); + assertResults(nodeProcess.stdout); + expect(nodeProcess.stdout).toMatch('1234'); + }); + }); + + describe('directory', ({ test }) => { + const importPath = './lib/cjs-ext-js'; + + test('Load', async () => { + const nodeProcess = await node.load(importPath); + assertResults(nodeProcess.stdout); + }); + + test('Import', async () => { + const nodeProcess = await node.importDynamic(importPath); + + if (semver.satisfies(node.version, nodeSupports.import)) { + expect(nodeProcess.stderr).toMatch('Directory import'); + } else { + assertResults(nodeProcess.stdout); + expect(nodeProcess.stdout).toMatch('{"default":1234}'); + } + }); + + test('Require', async () => { + const nodeProcess = await node.require(importPath); + assertResults(nodeProcess.stdout); + expect(nodeProcess.stdout).toMatch('1234'); + }); + }); + }); }); }); diff --git a/tests/specs/javascript/index.ts b/tests/specs/javascript/index.ts index 6084fce..5583671 100644 --- a/tests/specs/javascript/index.ts +++ b/tests/specs/javascript/index.ts @@ -7,13 +7,13 @@ export default testSuite(async ({ describe }, node: NodeApis) => { import('./cjs.js'), node, ); - // runTestSuite( - // import('./esm.js'), - // node, - // ); - // runTestSuite( - // import('./dependencies.js'), - // node, - // ); + runTestSuite( + import('./esm.js'), + node, + ); + runTestSuite( + import('./dependencies.js'), + node, + ); }); }); diff --git a/tests/utils/node-with-loader.ts b/tests/utils/node-with-loader.ts index 4e5dfdd..6a51bee 100644 --- a/tests/utils/node-with-loader.ts +++ b/tests/utils/node-with-loader.ts @@ -45,8 +45,6 @@ export async function createNode( arch: 'x64', }); - console.log('downloaded', node); - return { version: node.version, load(