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
This commit is contained in:
dongmucat 2026-05-14 10:13:32 +08:00
parent 9643e4157c
commit 8a7770c5e3
2 changed files with 3 additions and 2 deletions

View file

@ -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
})

View file

@ -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,