@@ -77,7 +77,7 @@ function mockWebSocketStream(options: MockWebSocketStreamOptions = {}) {
7777 onUrl,
7878 } = options ;
7979
80- return vi . mocked ( WebSocketStream ) . mockImplementationOnce ( ( url ) => {
80+ return vi . mocked ( WebSocketStream ) . mockImplementationOnce ( function ( url ) {
8181 onUrl ?.( url ) ;
8282 return {
8383 url : 'wss://test.livekit.io' ,
@@ -283,7 +283,7 @@ describe('SignalClient.connect', () => {
283283 it ( 'should reject when AbortSignal is triggered' , async ( ) => {
284284 const abortController = new AbortController ( ) ;
285285
286- vi . mocked ( WebSocketStream ) . mockImplementation ( ( ) => {
286+ vi . mocked ( WebSocketStream ) . mockImplementation ( function ( ) {
287287 // Simulate abort
288288 setTimeout ( ( ) => abortController . abort ( new Error ( 'User aborted connection' ) ) , 50 ) ;
289289
@@ -344,7 +344,7 @@ describe('SignalClient.connect', () => {
344344 extensions : '' ,
345345 } ;
346346
347- vi . mocked ( WebSocketStream ) . mockImplementation ( ( ) => {
347+ vi . mocked ( WebSocketStream ) . mockImplementation ( function ( ) {
348348 return {
349349 url : 'wss://test.livekit.io' ,
350350 opened : Promise . resolve ( mockConnection ) ,
@@ -526,7 +526,7 @@ describe('SignalClient.connect', () => {
526526 closedResolve = resolve ;
527527 } ) ;
528528
529- vi . mocked ( WebSocketStream ) . mockImplementation ( ( ) => {
529+ vi . mocked ( WebSocketStream ) . mockImplementation ( function ( ) {
530530 // Simulate close during connection
531531 queueMicrotask ( ( ) => {
532532 closedResolve ( { closeCode : 1006 , reason : 'Connection lost' } ) ;
0 commit comments