apollographql / graphql-subscriptions

:newspaper: A small module that implements GraphQL subscriptions for Node.js
MIT License
1.59k stars 133 forks source link

How to write integration tests of graphql-js subscriptions ? #125

Closed aatif-lahore closed 6 years ago

aatif-lahore commented 6 years ago

I am using loopback-graphql-relay and I am able to test mutations and queries using mocha. I need to test subscriptions as well.

The only guide I found on google is this. But It is not working. Is there any other example?

grantwwu commented 6 years ago

I don't know anything about how Loopback works, but it depends on your setup - you presumably use a client to both publish events to whatever you're using to back these subscriptions, and then use the client to also subscribe, and then test that it behaves correctly.

I'm going to close this issue for now since it's been a while there was last any activity on it, and it was not clear what action to take here. I'm going to leave conversation open, so feel free to respond if you want to pursue this further.