Replies: 1 comment
-
|
Hi, @simondell. Thanks for raising this. MSW patches the That being said, MSW guarantees that connections not matching your |
Beta Was this translation helpful? Give feedback.
-
|
Hi, @simondell. Thanks for raising this. MSW patches the That being said, MSW guarantees that connections not matching your |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi folks,
My app includes this in its MSW handlers configuration:
And elsewhere I have this:
So, with this setup, I would expect MSW would not trap my websocket connection attempts. This is intentional because I'm doing some early stage configuration to prove I can talk to the socket. I'm doing it from my local dev environment so that I don't have to wait for remote deployments every time I change some code, so I want to (temporarily) have the real URL in my local build (but keeping all the other MSW handlers mocking HTTP requests).
But, the browser console makes it seem as if MSW is successfully catching the WS connection request.
If I replace the URL in the MSW config
ws.link(nonsense:/made.up.domain);`... then it still traps the connection and appears to make and maintain the mock socket connection.The docs say:
... but this doesn't seem to be the case. It seems like the predicate is interpreted as "is it a valid URL", rather than "is this the url".
Is this intentional? Have I misunderstood the API?
Beta Was this translation helpful? Give feedback.
All reactions