test(query): add Vitest regression tests for milestone.complete version arg (fix #2644)

milestoneComplete was imported in decomposed-handlers.test.ts but had zero
test coverage. The original defect (6f79b1d) called phasesArchive([], ...)
instead of forwarding the positional version arg; the wrapping try/catch
swallowed the GSDError into { completed: false, reason: String(err) },
masking a programming error as a legitimate negative answer.

Add five Vitest tests that lock in the correct contract:
- positional version arg is extracted from args[0] and echoed in response
- missing version throws GSDError (not masked as completed: false)
- --archive-phases flag is processed
- --name flag sets milestone name
- response shape has version/date/phases/milestones_updated fields

Closes #2644

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Tom Boucher
2026-04-26 10:18:08 -04:00
parent f3685d9173
commit f8a0e6f145
2 changed files with 69 additions and 1 deletions

2
sdk/package-lock.json generated
View File

@@ -22,7 +22,7 @@
"vitest": "^3.1.1"
},
"engines": {
"node": ">=20"
"node": ">=22.0.0"
}
},
"node_modules/@anthropic-ai/claude-agent-sdk": {