File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed
src/services/mcp/__tests__ Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -643,11 +643,18 @@ describe("McpHub", () => {
643643
644644 // Verify that only the enabled server was connected
645645 expect ( StdioClientTransport ) . toHaveBeenCalledTimes ( 1 )
646- expect ( StdioClientTransport ) . toHaveBeenCalledWith (
647- expect . objectContaining ( {
648- args : [ "test2.js" ] , // Only the enabled server
649- } ) ,
650- )
646+
647+ // Check the call arguments - handle Windows cmd.exe wrapping
648+ const callArgs = StdioClientTransport . mock . calls [ 0 ] [ 0 ]
649+ if ( process . platform === "win32" ) {
650+ // On Windows, commands are wrapped with cmd.exe
651+ expect ( callArgs . command ) . toBe ( "cmd.exe" )
652+ expect ( callArgs . args ) . toEqual ( [ "/c" , "node" , "test2.js" ] )
653+ } else {
654+ // On other platforms, no wrapping
655+ expect ( callArgs . command ) . toBe ( "node" )
656+ expect ( callArgs . args ) . toEqual ( [ "test2.js" ] )
657+ }
651658 } )
652659
653660 it ( "should disconnect server when toggling to disabled" , async ( ) => {
You can’t perform that action at this time.
0 commit comments