Course lesson

Prevent Server-to-client Message Forwarding in MSW

By default, once we establish the actual WebSocket server connection in the mock, all the server events will be forwarded to the client. You can opt-out from this default behavior by calling event.preventDefault() on any intercepted server event.

Duration
2 min
Access
Free
Transcript
Needs source

By default, once we establish the actual WebSocket server connection in the mock, all the server events will be forwarded to the client. You can opt-out from this default behavior by calling event.preventDefault() on any intercepted server event.

Resources