@@ -217,23 +217,23 @@ describe('MCP Connection Integration Tests', () => {
217217
218218 const testScenarios = [
219219 // Working examples with auto transport (should pass)
220- { serverName : 'hono-mcp' , transportType : 'auto' as const , shouldPass : true } ,
221- { serverName : 'cf-agents' , transportType : 'auto' as const , shouldPass : true } ,
220+ { serverName : 'hono-mcp' , transportType : 'auto' as const } ,
221+ { serverName : 'cf-agents' , transportType : 'auto' as const } ,
222222
223223 // SSE endpoint with SSE transport (should pass)
224- { serverName : 'cf-agents-sse' , transportType : 'sse' as const , shouldPass : true } ,
224+ { serverName : 'cf-agents-sse' , transportType : 'sse' as const } ,
225225
226226 // Additional test cases for HTTP transport
227- { serverName : 'hono-mcp' , transportType : 'http' as const , shouldPass : true } ,
228- { serverName : 'cf-agents' , transportType : 'http' as const , shouldPass : true } ,
227+ { serverName : 'hono-mcp' , transportType : 'http' as const } ,
228+ { serverName : 'cf-agents' , transportType : 'http' as const } ,
229229
230230 // Failing case: SSE endpoint with auto transport (should fail)
231- { serverName : 'cf-agents-sse' , transportType : 'auto' as const , shouldPass : false } ,
231+ { serverName : 'cf-agents-sse' , transportType : 'auto' as const } ,
232232 ]
233233
234234 test . each ( testScenarios ) (
235235 'should connect to $serverName with $transportType transport (expect: $shouldPass)' ,
236- async ( { serverName, transportType, shouldPass } ) => {
236+ async ( { serverName, transportType } ) => {
237237 const servers = getMCPServers ( )
238238 const server = servers . find ( ( s ) => s . name === serverName )
239239
@@ -245,38 +245,25 @@ describe('MCP Connection Integration Tests', () => {
245245
246246 const result = await connectToMCPServer ( page , server . url , transportType )
247247
248- if ( shouldPass ) {
249- if ( result . success ) {
250- console . log ( `✅ Successfully connected to ${ server . name } ` )
251- console . log ( `📋 Available tools (${ result . tools . length } ):` )
252- result . tools . forEach ( ( tool , index ) => {
253- console . log ( ` ${ index + 1 } . ${ tool } ` )
254- } )
255-
256- // Verify connection success
257- expect ( result . success ) . toBe ( true )
258- expect ( result . tools . length ) . toBeGreaterThanOrEqual ( server . expectedTools )
259- } else {
260- console . log ( `❌ Failed to connect to ${ server . name } ` )
261- if ( result . debugLog ) {
262- console . log ( `🐛 Debug log:` )
263- console . log ( result . debugLog )
264- }
248+ if ( result . success ) {
249+ console . log ( `✅ Successfully connected to ${ server . name } ` )
250+ console . log ( `📋 Available tools (${ result . tools . length } ):` )
251+ result . tools . forEach ( ( tool , index ) => {
252+ console . log ( ` ${ index + 1 } . ${ tool } ` )
253+ } )
265254
266- // Fail the test with detailed information
267- throw new Error ( `Expected to connect to ${ server . name } with ${ transportType } transport but failed. Debug log: ${ result . debugLog } ` )
268- }
255+ // Verify connection success
256+ expect ( result . success ) . toBe ( true )
257+ expect ( result . tools . length ) . toBeGreaterThanOrEqual ( server . expectedTools )
269258 } else {
270- // Expect failure
271- if ( result . success ) {
272- console . log ( `❌ Unexpectedly connected to ${ server . name } ` )
273- throw new Error ( `Expected connection to ${ server . name } with ${ transportType } transport to fail, but it succeeded` )
274- } else {
275- console . log ( `✅ Connection to ${ server . name } failed as expected` )
276- console . log ( `🐛 Debug log: ${ result . debugLog } ` )
277- // Verify it's actually a failure
278- expect ( result . success ) . toBe ( false )
259+ console . log ( `❌ Failed to connect to ${ server . name } ` )
260+ if ( result . debugLog ) {
261+ console . log ( `🐛 Debug log:` )
262+ console . log ( result . debugLog )
279263 }
264+
265+ // Fail the test with detailed information
266+ throw new Error ( `Expected to connect to ${ server . name } with ${ transportType } transport but failed. Debug log: ${ result . debugLog } ` )
280267 }
281268 } ,
282269 45000 ,
0 commit comments