@@ -68,71 +68,6 @@ describe("SSEClientTransport", () => {
68
68
} ) ;
69
69
70
70
describe ( "connection handling" , ( ) => {
71
- it ( "maintains custom path when constructing endpoint URL" , async ( ) => {
72
- // Create a URL with a custom path
73
- const customPathUrl = new URL ( "/custom/path/sse" , baseUrl ) ;
74
- transport = new SSEClientTransport ( customPathUrl ) ;
75
-
76
- // Start the transport
77
- await transport . start ( ) ;
78
-
79
- // Send a test message to verify the endpoint URL
80
- const message : JSONRPCMessage = {
81
- jsonrpc : "2.0" ,
82
- id : "test-1" ,
83
- method : "test" ,
84
- params : { }
85
- } ;
86
-
87
- await transport . send ( message ) ;
88
-
89
- // Verify the POST request maintains the custom path
90
- expect ( lastServerRequest . url ) . toBe ( "/custom/path/sse" ) ;
91
- } ) ;
92
-
93
- it ( "handles multiple levels of custom paths" , async ( ) => {
94
- // Test with a deeper nested path
95
- const nestedPathUrl = new URL ( "/api/v1/custom/deep/path/sse" , baseUrl ) ;
96
- transport = new SSEClientTransport ( nestedPathUrl ) ;
97
-
98
- await transport . start ( ) ;
99
-
100
- const message : JSONRPCMessage = {
101
- jsonrpc : "2.0" ,
102
- id : "test-1" ,
103
- method : "test" ,
104
- params : { }
105
- } ;
106
-
107
- await transport . send ( message ) ;
108
-
109
- // Verify the POST request maintains the full custom path
110
- expect ( lastServerRequest . url ) . toBe ( "/api/v1/custom/deep/path/sse" ) ;
111
- } ) ;
112
-
113
- it ( "maintains custom path for SSE connection" , async ( ) => {
114
- const customPathUrl = new URL ( "/custom/path/sse" , baseUrl ) ;
115
- transport = new SSEClientTransport ( customPathUrl ) ;
116
- await transport . start ( ) ;
117
- expect ( lastServerRequest . url ) . toBe ( "/custom/path/sse" ) ;
118
- } ) ;
119
-
120
- it ( "handles URLs with query parameters" , async ( ) => {
121
- const urlWithQuery = new URL ( "/custom/path/sse?param=value" , baseUrl ) ;
122
- transport = new SSEClientTransport ( urlWithQuery ) ;
123
- await transport . start ( ) ;
124
-
125
- const message : JSONRPCMessage = {
126
- jsonrpc : "2.0" ,
127
- id : "test-1" ,
128
- method : "test" ,
129
- params : { }
130
- } ;
131
-
132
- await transport . send ( message ) ;
133
- expect ( lastServerRequest . url ) . toBe ( "/custom/path/sse" ) ;
134
- } ) ;
135
-
136
71
it ( "establishes SSE connection and receives endpoint" , async ( ) => {
137
72
transport = new SSEClientTransport ( baseUrl ) ;
138
73
await transport . start ( ) ;
0 commit comments