Mike-Gibson / mock-apollo-client

Helps unit test components which use the Apollo Client.
MIT License
117 stars 15 forks source link

Q: Debugging when a handler is not evaluated as called #52

Closed sschneider-ihre-pvs closed 7 months ago

sschneider-ihre-pvs commented 1 year ago

I currently have the problem that an errorhandler seems to be not been called on a faulty graphql request. Is there a way to find the cause why the called counter was not incremented? Are there any debug information available from the mocked client?

Mike-Gibson commented 1 year ago

The mock client should throw an error if a query is made but there's no handler defined (code )

You can assert that a request handler is being called if you're using a spy function as the handler, so that might help with knowing whether your client code is calling the handler or not.

Otherwise, there's nothing else in the mock client that could help I'm afraid.

Are you able to debug and step through the unit test - maybe that will help understand what's going on.

Mike-Gibson commented 7 months ago

Closing due to inactivity - please re-open if you are able to provide more info.