Skip to content

Commit 9620738

Browse files
grimmerkclaude
andcommitted
Fix TypeScript errors in undefined parameter tests
- Update client.callTool() calls to use correct API signature - Add type assertions for callResult.content to fix TypeScript strict mode errors 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent d086b5f commit 9620738

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/server/mcp.test.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -884,9 +884,10 @@ describe('tool()', () => {
884884
expect(result.tools[0].name).toBe('test');
885885
expect(result.tools[0].description).toBe('A tool description');
886886

887-
const callResult = await client.callTool('test', { name: 'World' });
887+
const callResult = await client.callTool({ name: 'test', arguments: { name: 'World' } });
888888
expect(callResult.content).toHaveLength(1);
889-
expect(callResult.content[0]).toMatchObject({
889+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
890+
expect((callResult.content as any)[0]).toMatchObject({
890891
type: 'text',
891892
text: 'Hello, World!'
892893
});
@@ -929,9 +930,10 @@ describe('tool()', () => {
929930
expect(result.tools[0].name).toBe('test');
930931
expect(result.tools[0].description).toBeUndefined();
931932

932-
const callResult = await client.callTool('test', { name: 'World' });
933+
const callResult = await client.callTool({ name: 'test', arguments: { name: 'World' } });
933934
expect(callResult.content).toHaveLength(1);
934-
expect(callResult.content[0]).toMatchObject({
935+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
936+
expect((callResult.content as any)[0]).toMatchObject({
935937
type: 'text',
936938
text: 'Hello, World!'
937939
});
@@ -983,9 +985,10 @@ describe('tool()', () => {
983985
readOnlyHint: true
984986
});
985987

986-
const callResult = await client.callTool('test', {});
988+
const callResult = await client.callTool({ name: 'test' });
987989
expect(callResult.content).toHaveLength(1);
988-
expect(callResult.content[0]).toMatchObject({
990+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
991+
expect((callResult.content as any)[0]).toMatchObject({
989992
type: 'text',
990993
text: 'Hello!'
991994
});

0 commit comments

Comments
 (0)