Skip to content

Commit

Permalink
ci: Deno v2 doesn't support .cts extension (#744)
Browse files Browse the repository at this point in the history
* ci: Deno v2 doesnt support `.cts` extension

* ci: fix pass counter

* ci: improve debug logs
  • Loading branch information
wellwelwel authored Sep 7, 2024
1 parent 523ba74 commit 5c614b8
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions test/e2e/runners.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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');
Expand All @@ -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');
}));
});

0 comments on commit 5c614b8

Please sign in to comment.