test(server): unit-test slash-command parser + dispatcher (#273 follow-up) #289
No reviewers
Labels
No labels
area:agents
area:dashboard
area:database
area:design
area:design-review
area:flows
area:infra
area:meta
area:security
area:sessions
area:webhook
area:workdir
security
type:bug
type:chore
type:meta
type:user-story
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/claude-hooks!289
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "test/s11-slash-commands"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
PR #273 s11 extraction follow-up. Covers
slash-commands.ts.Coverage (16 tests)
parseRaiseCapCommand—/raise-cap $10,/raise-cap 10,/raise-cap(no arg), invalid input,$-5rejection (dollar-strip then ≤0 gate)applyRaiseCapCommandmiss branch — no running task + ack comment.catch()swallowWhat's NOT covered here (deliberate)
slash-commands.ts— the module importsForgejoAdapter,parseRepo,listResolvedAgents,getWorker,dispatchByType,raiseTaskCostCapdirectly. TheapplyRaiseCapCommand"currentTask match" branch requires a full Worker fixture that can't be built withoutmock.module. Documented in the test file's top comment. Adding animpl-style seam is a future refactor.dispatchBreakdown— already covered bybreakdown.test.tsviamock.module("../dispatch/registry"). Not duplicated.webhook-handlers.ts(webhook signature) andmain.ts(/breakdownHTTP auth). Not in this module's responsibility.Checks
bunx tsc --noEmit -p apps/server/tsconfig.json— EXIT=0bun test apps/server/src/domain/workflow/slash-commands.test.ts— 16/16 pass