watchQuery never resolving in tests
See original GitHub issueI have a case where we call apollo.watchQuery(...)
(via import { queryManager } from 'ember-apollo-client';
), which never “finishes” in our test (it does resolve, but the test waiters do not continue). Replacing it with apollo.query()
works as expected, but otherwise the test just hangs on await visit(...)
and never resolves. Any ideas on this, or ways to work around this?
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (7 by maintainers)
Top Results From Across the Web
jest testing apollo provider getting error : TypeError: this.client ...
then I wrapped component in apollo provider with prop client while testing. TypeError: this.client.watchQuery is not a function 732 | 733 | it(' ......
Read more >Testing Apollo's Query Component - Apollo GraphQL Blog
This behavior affects how tests should be written for components that use react-apollo . This guide will explain step-by-step how to test react- ......
Read more >Writing Tests for Apollo Client in React - Robin Wieruch
The tutorial builds up on a mocked GraphQL API enabling you to write tests for your Apollo Client queries and mutations in React....
Read more >Unit testing a Flutter GraphQL app | by Dana Hartweg - Medium
Watch query test harness. Lines 24–28 are more mocktail specific setup, but nothing we haven't seen before; Lines 1–2 set things up ...
Read more >Queries – Angular - GraphQL Code Generator
watchQuery method in a very simple way. We simply need to parse our query into a GraphQL document using the gql tag from...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hmm, I guess it would make sense to call
clearStore()
in thewillDestroy()
hook of the apollo service? I will make a PR for that!@gfmartinez a dummy app would be great but a gist with a config.js sample and sample test, would also be valuable. Even better if that example could be linked to from the readme for this add-on