From 5c614b83369bc55f8446403bb23c31be3af7d316 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Weslley=20Ara=C3=BAjo?= <46850407+wellwelwel@users.noreply.github.com> Date: Fri, 6 Sep 2024 21:54:44 -0300 Subject: [PATCH] ci: Deno v2 doesn't support `.cts` extension (#744) * ci: Deno v2 doesnt support `.cts` extension * ci: fix pass counter * ci: improve debug logs --- test/e2e/runners.test.ts | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/test/e2e/runners.test.ts b/test/e2e/runners.test.ts index fb854e59..cd800a65 100644 --- a/test/e2e/runners.test.ts +++ b/test/e2e/runners.test.ts @@ -40,9 +40,14 @@ describe('Test Runtimes/Platforms + Extensions', async () => { hasNode && (await it('Node.js', async () => { const output = await inspectCLI( - 'npx tsx src/bin/index.ts --platform=node test/__fixtures__/e2e/extensions' + 'npx tsx src/bin/index.ts --platform=node test/__fixtures__/e2e/extensions -d' ); + if (output.exitCode !== 0) { + console.log(output.stdout); + console.log(output.stderr); + } + assert.strictEqual(output.exitCode, 0, 'Exit Code needs to be 0'); assert(/PASS › 12/.test(output.stdout), 'CLI needs to pass 1'); assert(/FAIL › 0/.test(output.stdout), 'CLI needs to fail 0'); @@ -57,9 +62,14 @@ describe('Test Runtimes/Platforms + Extensions', async () => { hasBun && (await it('Bun', async () => { const output = await inspectCLI( - 'bun src/bin/index.ts --platform=bun test/__fixtures__/e2e/extensions' + 'bun src/bin/index.ts --platform=bun test/__fixtures__/e2e/extensions -d' ); + if (output.exitCode !== 0) { + console.log(output.stdout); + console.log(output.stderr); + } + assert.strictEqual(output.exitCode, 0, 'Exit Code needs to be 0'); assert(/PASS › 12/.test(output.stdout), 'CLI needs to pass 1'); assert(/FAIL › 0/.test(output.stdout), 'CLI needs to fail 0'); @@ -74,17 +84,22 @@ describe('Test Runtimes/Platforms + Extensions', async () => { hasDeno && (await it('Deno', async () => { const output = await inspectCLI( - 'deno run --unstable-sloppy-imports --allow-read --allow-env --allow-run src/bin/index.ts --platform=deno test/__fixtures__/e2e/extensions' + 'deno run --unstable-sloppy-imports --allow-read --allow-env --allow-run src/bin/index.ts --platform=deno test/__fixtures__/e2e/extensions -d --exclude=.cts' ); + if (output.exitCode !== 0) { + console.log(output.stdout); + console.log(output.stderr); + } + assert.strictEqual(output.exitCode, 0, 'Exit Code needs to be 0'); - assert(/PASS › 12/.test(output.stdout), 'CLI needs to pass 1'); + assert(/PASS › 10/.test(output.stdout), 'CLI needs to pass 1'); assert(/FAIL › 0/.test(output.stdout), 'CLI needs to fail 0'); assert(/deno run.+?.js/.test(output.stdout), 'deno => .js'); assert(/deno run.+?.cjs/.test(output.stdout), 'deno => .cjs'); assert(/deno run.+?.mjs/.test(output.stdout), 'deno => .mjs'); assert(/deno run.+?.ts/.test(output.stdout), 'deno => .ts'); - assert(/deno run.+?.cts/.test(output.stdout), 'deno => .cts'); + // assert(/deno run.+?.cts/.test(output.stdout), 'deno => .cts'); assert(/deno run.+?.mts/.test(output.stdout), 'deno => .mts'); })); });