Closed nemonemi closed 5 months ago
Hi, @nemonemi.
You can certainly use this library standalone, if you so wish. Just be mindful of what this library doesn't do (things you'd have to build yourself, like request matching). For general purpose mocking, I highly recommend using MSW, which uses Interceptors for mocking requests in Node.js.
WebSocket interception is described as-is. The README mentions everything you need to intercept a WebSocket connection and mock incoming/outgoing events.
The more "complete" solution is the ws
API coming to MSW. Learn more and also how to use it right here: https://github.com/mswjs/msw/discussions/2010.
Hello, I understand that this is a low-level library, but does that mean that we shouldn't be using it at all?
Looking at the documentation it is not clear on how to actually mock the webSocket subscription.
Could you please provide a complete solution?