@@ -23,29 +23,29 @@ describe('eventIterator Status Management', () => {
2323
2424 it ( 'invokes the callback immediately if notifyImmediately is true' , ( ) => {
2525 const callback = vi . fn ( )
26- onEventIteratorStatusChange ( dummyIterator , callback , true )
26+ onEventIteratorStatusChange ( dummyIterator , callback , { notifyImmediately : true } )
2727 // The callback should be called right away with the current status.
2828 expect ( callback ) . toHaveBeenCalledWith ( 'connected' )
2929 } )
3030
3131 it ( 'does not invoke the callback immediately if notifyImmediately is false' , ( ) => {
3232 const callback = vi . fn ( )
33- onEventIteratorStatusChange ( dummyIterator , callback , false )
33+ onEventIteratorStatusChange ( dummyIterator , callback , { notifyImmediately : false } )
3434 // Since immediate notification is disabled, the callback should not have been called.
3535 expect ( callback ) . not . toHaveBeenCalled ( )
3636 } )
3737
3838 it ( 'calls the callback when the status is updated' , ( ) => {
3939 const callback = vi . fn ( )
40- onEventIteratorStatusChange ( dummyIterator , callback , false )
40+ onEventIteratorStatusChange ( dummyIterator , callback , { notifyImmediately : false } )
4141 updateEventIteratorStatus ( initialState , 'reconnecting' )
4242 // The callback should be called with the new status.
4343 expect ( callback ) . toHaveBeenCalledWith ( 'reconnecting' )
4444 } )
4545
4646 it ( 'does not call the callback if the status is updated to the same value' , ( ) => {
4747 const callback = vi . fn ( )
48- onEventIteratorStatusChange ( dummyIterator , callback , false )
48+ onEventIteratorStatusChange ( dummyIterator , callback , { notifyImmediately : false } )
4949 // Update with the same status as the initial one.
5050 updateEventIteratorStatus ( initialState , 'connected' )
5151 // The callback should not be triggered.
@@ -54,7 +54,7 @@ describe('eventIterator Status Management', () => {
5454
5555 it ( 'removes the listener when unsubscribed' , ( ) => {
5656 const callback = vi . fn ( )
57- const unsubscribe = onEventIteratorStatusChange ( dummyIterator , callback , false )
57+ const unsubscribe = onEventIteratorStatusChange ( dummyIterator , callback , { notifyImmediately : false } )
5858 // Update status to trigger the callback.
5959 updateEventIteratorStatus ( initialState , 'reconnecting' )
6060 expect ( callback ) . toHaveBeenCalledTimes ( 1 )
0 commit comments