jest-websocket-mock icon indicating copy to clipboard operation
jest-websocket-mock copied to clipboard

Is there a way to simulate a lost connection?

Open ElectricCoffee opened this issue 1 year ago • 1 comments

I can see that the library supports close and error, one of which gracefully shuts down the connection, and the other which sends an error message; but I want to simulate the connection abruptly and ungracefully being lost (running out of data, losing wifi, ethernet unplugged, etc). How would I go about doing that?

ElectricCoffee avatar Jan 05 '24 12:01 ElectricCoffee

+1

davidmoshal avatar Jan 18 '24 04:01 davidmoshal

Anyone found a way to do so?

I'm trying to write a test that ensure my client correctly reconnects...

Adesin-fr avatar Nov 10 '24 09:11 Adesin-fr

I am facing the same issue, did not find any way.

yuv-c avatar May 25 '25 08:05 yuv-c