-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do you need to import the WebSocket in this example? #386
Comments
See https://github.com/thoov/mock-socket#stubbing-the-global |
Right, but if you use this on the server-side, it does not look like it does. |
This library is intended for testing the client, so the WebSocket connecting to the mocked Server instead of the real one. Server-side tests require another types of tests according to the server library implementation, so anyway you need to stub the protocol on the server. If you want to use it on the server anyway, you need to import both |
That's exactly my point. Maybe a clarification in the example would help? After all, this example is simply under "Usage", no mention of the specific environment. |
In this code
mock-socket/README.md
Lines 39 to 44 in 47eab99
is
WebSocket
a regular one, or should it be imported from the library so that it can be mocked. In other word, is the URL mocked or the URL and the websocket?The text was updated successfully, but these errors were encountered: