@@ -173,8 +173,12 @@ describe("useConnection", () => {
173173 } ) ;
174174
175175 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 ;
178182
179183 beforeEach ( ( ) => {
180184 jest . clearAllMocks ( ) ;
@@ -194,7 +198,9 @@ describe("useConnection", () => {
194198 } ) ;
195199
196200 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+ ) ;
198204 } ) ;
199205
200206 test ( "preserves HTTP port number when connecting" , async ( ) => {
@@ -211,7 +217,9 @@ describe("useConnection", () => {
211217 } ) ;
212218
213219 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+ ) ;
215223 } ) ;
216224
217225 test ( "uses default port for HTTPS when not specified" , async ( ) => {
@@ -246,7 +254,9 @@ describe("useConnection", () => {
246254 } ) ;
247255
248256 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+ ) ;
250260 } ) ;
251261 } ) ;
252262} ) ;
0 commit comments