jest-websocket-mock
jest-websocket-mock copied to clipboard
Is there a way to simulate a lost connection?
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?
+1
Anyone found a way to do so?
I'm trying to write a test that ensure my client correctly reconnects...
I am facing the same issue, did not find any way.