You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there any documentation for how to write tests for components that make calls to useQuery and useMutation?
What should I use in tests since the entire app is wrapped in urql's Provider? In tests, I need access to that context, but I need the ability to provide it mocked data. apollo-client offers a MockedProvider which takes a mocks prop that I can provide mocked data, but I'm not quite sure what to do in the case of urql.
The text was updated successfully, but these errors were encountered:
bstro
changed the title
Testing
How to write tests with Provider
Feb 20, 2020
I’ve heard about this exchange being used to test. This creates your own miniature resolver. I’m thinking if we can abstract it further but personally I think it’s a good start.
Hope this helps you out, feel free to express any concerns you have with that approach.
We're also working on integrating a similar solution: #474
Is there any documentation for how to write tests for components that make calls to
useQuery
anduseMutation
?What should I use in tests since the entire app is wrapped in urql's
Provider
? In tests, I need access to that context, but I need the ability to provide it mocked data.apollo-client
offers aMockedProvider
which takes amocks
prop that I can provide mocked data, but I'm not quite sure what to do in the case of urql.The text was updated successfully, but these errors were encountered: