Replies: 1 comment 1 reply
-
Node does not have a WebSocket implementation in the global object, you must supply your own (which is what the error suggests). On how to test, I personally start a real server and connect to it as if it were any other. I dont mock requests because I want to test the whole transport and the library's behavior within. You can check my test suites under |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to setup tests for a react native app that uses graphql-ws for subscriptions. However, I am unsure how can I achieve this? Any directions would be very helpful.
I think I need to mock the
createClient
method exported fromgraphql-ws
but beyond that, I am clueless about how to do it.import { createClient as createWSClient } from "graphql-ws";
The following error appears when I run
yarn test
Beta Was this translation helpful? Give feedback.
All reactions