From 8a7770c5e365963ddea8b58b3d4a7eae8e26e6b4 Mon Sep 17 00:00:00 2001 From: dongmucat <1127093059@qq.com> Date: Thu, 14 May 2026 10:13:32 +0800 Subject: [PATCH] test(cli): fix Windows path assertion and clarify test name - Fix Windows test failure by using regex that accepts both / and \ path separators in install-command.test.ts - Rename contradictory test case in publish-command.test.ts from "surfaces a non-zero exit" to "is handled without crash" to match actual assertion behavior --- cli/test/integration/install-command.test.ts | 3 ++- cli/test/integration/publish-command.test.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cli/test/integration/install-command.test.ts b/cli/test/integration/install-command.test.ts index 942fbbe5..854d8c5b 100644 --- a/cli/test/integration/install-command.test.ts +++ b/cli/test/integration/install-command.test.ts @@ -628,7 +628,8 @@ describe('install command — multi-agent & auto-detect', () => { expect(parsed.installed[0]?.agent).toBe('codex') // On macOS env.cwd may resolve through /private/var/... symlinks; assert // against the structural part of the path instead of an exact prefix. - expect(parsed.installed[0]?.dir).toContain('/.codex/skills/pdf-parser') + // Use a regex that accepts both Unix (/) and Windows (\) path separators. + expect(parsed.installed[0]?.dir).toMatch(/[/\\]\.codex[/\\]skills[/\\]pdf-parser/) expect(parsed.installed[0]?.dir).not.toContain(env.home) // not user-level }) diff --git a/cli/test/integration/publish-command.test.ts b/cli/test/integration/publish-command.test.ts index 96b55283..e96102cb 100644 --- a/cli/test/integration/publish-command.test.ts +++ b/cli/test/integration/publish-command.test.ts @@ -460,7 +460,7 @@ describe('publish command — content shape', () => { } }) - test('publish response missing required fields surfaces a non-zero exit', async () => { + test('publish response missing required fields is handled without crash', async () => { const env = await createTempHome() const server = Bun.serve({ port: 0,