File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -273,10 +273,15 @@ describe("TriggerChatTransport", function () {
273273 expect ( observedStreamPath ) . toBe ( "/realtime/v1/streams/run_trailing_baseurl/chat-stream" ) ;
274274 } ) ;
275275
276- it ( "normalizes repeated trailing slashes in baseURL for stream URLs" , async function ( ) {
276+ it ( "normalizes repeated trailing slashes in baseURL for trigger and stream URLs" , async function ( ) {
277+ let observedTriggerPath : string | undefined ;
277278 let observedStreamPath : string | undefined ;
278279
279280 const server = await startServer ( function ( req , res ) {
281+ if ( req . method === "POST" ) {
282+ observedTriggerPath = req . url ?? "" ;
283+ }
284+
280285 if ( req . method === "POST" && req . url === "/api/v1/tasks/chat-task/trigger" ) {
281286 res . writeHead ( 200 , {
282287 "content-type" : "application/json" ,
@@ -332,6 +337,7 @@ describe("TriggerChatTransport", function () {
332337
333338 const chunks = await readChunks ( stream ) ;
334339 expect ( chunks ) . toHaveLength ( 2 ) ;
340+ expect ( observedTriggerPath ) . toBe ( "/api/v1/tasks/chat-task/trigger" ) ;
335341 expect ( observedStreamPath ) . toBe ( "/realtime/v1/streams/run_multi_trailing_baseurl/chat-stream" ) ;
336342 } ) ;
337343
You can’t perform that action at this time.
0 commit comments