@@ -173,8 +173,12 @@ describe("useConnection", () => {
173
173
} ) ;
174
174
175
175
describe ( "URL Port Handling" , ( ) => {
176
- const SSEClientTransport = jest . requireMock ( "@modelcontextprotocol/sdk/client/sse.js" ) . SSEClientTransport ;
177
- const StreamableHTTPClientTransport = jest . requireMock ( "@modelcontextprotocol/sdk/client/streamableHttp.js" ) . StreamableHTTPClientTransport ;
176
+ const SSEClientTransport = jest . requireMock (
177
+ "@modelcontextprotocol/sdk/client/sse.js" ,
178
+ ) . SSEClientTransport ;
179
+ const StreamableHTTPClientTransport = jest . requireMock (
180
+ "@modelcontextprotocol/sdk/client/streamableHttp.js" ,
181
+ ) . StreamableHTTPClientTransport ;
178
182
179
183
beforeEach ( ( ) => {
180
184
jest . clearAllMocks ( ) ;
@@ -194,7 +198,9 @@ describe("useConnection", () => {
194
198
} ) ;
195
199
196
200
const call = SSEClientTransport . mock . calls [ 0 ] [ 0 ] ;
197
- expect ( call . toString ( ) ) . toContain ( "url=https%3A%2F%2Fexample.com%3A8443%2Fapi" ) ;
201
+ expect ( call . toString ( ) ) . toContain (
202
+ "url=https%3A%2F%2Fexample.com%3A8443%2Fapi" ,
203
+ ) ;
198
204
} ) ;
199
205
200
206
test ( "preserves HTTP port number when connecting" , async ( ) => {
@@ -211,7 +217,9 @@ describe("useConnection", () => {
211
217
} ) ;
212
218
213
219
const call = SSEClientTransport . mock . calls [ 0 ] [ 0 ] ;
214
- expect ( call . toString ( ) ) . toContain ( "url=http%3A%2F%2Flocalhost%3A3000%2Fapi" ) ;
220
+ expect ( call . toString ( ) ) . toContain (
221
+ "url=http%3A%2F%2Flocalhost%3A3000%2Fapi" ,
222
+ ) ;
215
223
} ) ;
216
224
217
225
test ( "uses default port for HTTPS when not specified" , async ( ) => {
@@ -246,7 +254,9 @@ describe("useConnection", () => {
246
254
} ) ;
247
255
248
256
const call = StreamableHTTPClientTransport . mock . calls [ 0 ] [ 0 ] ;
249
- expect ( call . toString ( ) ) . toContain ( "url=https%3A%2F%2Fexample.com%3A8443%2Fapi" ) ;
257
+ expect ( call . toString ( ) ) . toContain (
258
+ "url=https%3A%2F%2Fexample.com%3A8443%2Fapi" ,
259
+ ) ;
250
260
} ) ;
251
261
} ) ;
252
262
} ) ;
0 commit comments