Summary
The src/mcp-client.ts module currently lacks dedicated unit tests. While it is indirectly tested through integration tests in src/toolsets/tests/stackone.mcp-fetch.spec.ts, having unit tests would improve test coverage and make it easier to catch regressions.
Current State
mcp-client.ts is a thin wrapper around MCP SDK's Client and StreamableHTTPClientTransport- The
createMCPClient function creates and returns these instances along with an asyncDispose method - No dedicated unit tests exist for this module
Suggested Tests
- Verify
Client and Transport are correctly initialised with provided options - Test that
asyncDispose properly calls close() on both client and transport - Test header passing to transport
- Test error handling for invalid URLs
Related Files
src/mcp-client.tssrc/toolsets/tests/stackone.mcp-fetch.spec.ts (integration tests)
Summary
The
src/mcp-client.tsmodule currently lacks dedicated unit tests. While it is indirectly tested through integration tests insrc/toolsets/tests/stackone.mcp-fetch.spec.ts, having unit tests would improve test coverage and make it easier to catch regressions.Current State
mcp-client.tsis a thin wrapper around MCP SDK'sClientandStreamableHTTPClientTransportcreateMCPClientfunction creates and returns these instances along with anasyncDisposemethodSuggested Tests
ClientandTransportare correctly initialised with provided optionsasyncDisposeproperly callsclose()on both client and transportRelated Files
src/mcp-client.tssrc/toolsets/tests/stackone.mcp-fetch.spec.ts(integration tests)