From 06aca6ac6161a27d5f6ede6dc4a5ad3098d34e71 Mon Sep 17 00:00:00 2001 From: userquin Date: Fri, 13 Nov 2026 15:42:28 +0100 Subject: [PATCH 1/2] ci: fix publish test on Windows --- test/publish.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/publish.test.ts b/test/publish.test.ts index 0582a42..aabfeca 100644 --- a/test/publish.test.ts +++ b/test/publish.test.ts @@ -222,7 +222,7 @@ describe('publish', () => { writeFileSync(output, '') process.env.GITHUB_OUTPUT = output execFileSync.mockImplementation((cmd: string, args: string[]) => { - if (cmd === 'tar') return JSON.stringify({ name: args[1]!.includes('/b-') ? '@scope/b' : 'a', version: versionFromTarballName(args[1]!) }) + if (cmd === 'tar') return JSON.stringify({ name: args[1]!.includes('b-') ? '@scope/b' : 'a', version: versionFromTarballName(args[1]!) }) if (args[1] === 'ls') return 'latest: 1.0.0\n4x: 4.0.0\n' return '' }) From 7f642491002dda988cfca799783df3d4df6a1726 Mon Sep 17 00:00:00 2001 From: userquin Date: Fri, 13 Nov 2026 15:49:38 +0100 Subject: [PATCH 2/2] chore: use basename + startsWith instead using includes --- test/publish.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/publish.test.ts b/test/publish.test.ts index aabfeca..652980b 100644 --- a/test/publish.test.ts +++ b/test/publish.test.ts @@ -1,6 +1,6 @@ import { mkdtempSync, readFileSync, writeFileSync } from 'node:fs' import { tmpdir } from 'node:os' -import { resolve } from 'node:path' +import { basename, resolve } from 'node:path' import process from 'node:process' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' @@ -222,7 +222,7 @@ describe('publish', () => { writeFileSync(output, '') process.env.GITHUB_OUTPUT = output execFileSync.mockImplementation((cmd: string, args: string[]) => { - if (cmd === 'tar') return JSON.stringify({ name: args[1]!.includes('b-') ? '@scope/b' : 'a', version: versionFromTarballName(args[1]!) }) + if (cmd === 'tar') return JSON.stringify({ name: basename(args[1]!).startsWith('b-') ? '@scope/b' : 'a', version: versionFromTarballName(args[1]!) }) if (args[1] === 'ls') return 'latest: 1.0.0\n4x: 4.0.0\n' return '' })