@@ -495,21 +495,27 @@ describe("TriggerChatTransport", function () {
495495 } ) ;
496496
497497 it ( "returns null on reconnect when no active run exists" , async function ( ) {
498+ const errors : TriggerChatTransportError [ ] = [ ] ;
498499 const transport = new TriggerChatTransport ( {
499500 task : "chat-task" ,
500501 stream : "chat-stream" ,
501502 accessToken : "pk_trigger" ,
502503 baseURL : "https://api.trigger.dev" ,
504+ onError : function onError ( error ) {
505+ errors . push ( error ) ;
506+ } ,
503507 } ) ;
504508
505509 const stream = await transport . reconnectToStream ( {
506510 chatId : "missing-chat" ,
507511 } ) ;
508512
509513 expect ( stream ) . toBeNull ( ) ;
514+ expect ( errors ) . toHaveLength ( 0 ) ;
510515 } ) ;
511516
512517 it ( "removes inactive run entries during reconnect attempts" , async function ( ) {
518+ const errors : TriggerChatTransportError [ ] = [ ] ;
513519 const runStore = new TrackedRunStore ( ) ;
514520 runStore . set ( {
515521 chatId : "chat-inactive" ,
@@ -525,13 +531,17 @@ describe("TriggerChatTransport", function () {
525531 stream : "chat-stream" ,
526532 accessToken : "pk_trigger" ,
527533 runStore,
534+ onError : function onError ( error ) {
535+ errors . push ( error ) ;
536+ } ,
528537 } ) ;
529538
530539 const stream = await transport . reconnectToStream ( {
531540 chatId : "chat-inactive" ,
532541 } ) ;
533542
534543 expect ( stream ) . toBeNull ( ) ;
544+ expect ( errors ) . toHaveLength ( 0 ) ;
535545 expect ( runStore . deleteCalls ) . toContain ( "chat-inactive" ) ;
536546 expect ( runStore . get ( "chat-inactive" ) ) . toBeUndefined ( ) ;
537547 } ) ;
0 commit comments