Commit a75f74b
fix: add type casts for union type migration in protocol tests
This commit addresses type errors in test/shared/protocol.test.ts that arose
from migrating Request, Notification, and Result from interfaces to union types.
Key changes:
- Cast Protocol type parameters to base types (RequestBase, NotificationBase, ResultBase)
- Cast test request objects with fake methods (like 'test/method') to RequestBase or Request via `as unknown as Request`
- Fix setRequestHandler callback signatures to include `extra` parameter
- Cast Result return values with non-base properties to ResultBase or use `as any`
- Fix Zod v4 API usage (z.record requires 2 args, .optional() is method not function)
- Cast task creation test objects to Request union type
The union type migration makes the type system more strict, requiring explicit
casts in tests that use fake/test method names not in the actual protocol.
Some remaining type errors (~40) still need fixes, primarily:
- Additional createTask calls needing Request casts
- More Result objects with specific properties needing casts
- Test method strings needing casts to RequestBase
Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent d50c1c8 commit a75f74b
File tree
1 file changed
+102
-99
lines changed1 file changed
+102
-99
lines changed
0 commit comments