Skip to content

Commit e3e2d3f

Browse files
fix: add const assertions for TypeScript literal type inference
1 parent 674827d commit e3e2d3f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/server/mcp.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1710,17 +1710,17 @@ describe('tool()', () => {
17101710
// Test valid tool names
17111711
testServer.registerTool('valid-tool-name', {
17121712
description: 'A valid tool name'
1713-
}, async () => ({ content: [{ type: 'text', text: 'Success' }] }));
1713+
}, async () => ({ content: [{ type: 'text' as const, text: 'Success' }] }));
17141714

17151715
// Test tool name with warnings (starts with dash)
17161716
testServer.registerTool('-warning-tool', {
17171717
description: 'A tool name that generates warnings'
1718-
}, async () => ({ content: [{ type: 'text', text: 'Success' }] }));
1718+
}, async () => ({ content: [{ type: 'text' as const, text: 'Success' }] }));
17191719

17201720
// Test invalid tool name (contains spaces)
17211721
testServer.registerTool('invalid tool name', {
17221722
description: 'An invalid tool name'
1723-
}, async () => ({ content: [{ type: 'text', text: 'Success' }] }));
1723+
}, async () => ({ content: [{ type: 'text' as const, text: 'Success' }] }));
17241724

17251725
// Verify that warnings were issued (both for warnings and validation failures)
17261726
expect(warnSpy).toHaveBeenCalled();

0 commit comments

Comments
 (0)