Commit 0ee2baf
fix(test): resolve type errors in test/server/index.test.ts
- Add `as const` to `action: 'accept'` for proper literal typing in ElicitResult handlers
- Add return type annotations `: Promise<ElicitResult | CreateTaskResult>` to handlers returning union types
- Cast objects with `{ content: ... }` as CallToolResult for storeTaskResult calls
- Replace `undefined` with empty string `''` for optional username field to satisfy type constraints
- Add type narrowing with `!Array.isArray(result.content)` guard for content property access
- Cast ElicitResult objects as Result when passed to storeTaskResult
- Add @ts-expect-error directives for capability structures that don't match generated types but are needed for tests (tools/elicitation in tasks.requests)
All type errors fixed while maintaining test structure compatibility with main branch.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 21d9d22 commit 0ee2baf
1 file changed
+103
-62
lines changed
0 commit comments