Use case: we've implemented our own re-try logic that has a timeout if the web socket is stuck in connecting. And I would like to write tests for it
Another use case: short delay in between messages from server to client
Reply from @kettanaito in discussion
Hi. Yeah, we might want to support async listeners, too. That's already a thing for HTTP requests in Interceptors. Shouldn't be a big task to add that support for WebSocket. Mostly comes down to swapping this.emitter.emit with emitAsync(this.emitter, ...). You would then be able to use await delay() from msw in the connection listener to simulate pending connection.
Use case: we've implemented our own re-try logic that has a timeout if the web socket is stuck in connecting. And I would like to write tests for it
Another use case: short delay in between messages from server to client
Reply from @kettanaito in discussion