Skip to content

Error when trying to test component using useQuery from geschichte #38

Answered by BowlingX
Morritz asked this question in Q&A
Discussion options

You must be logged in to vote

Thank you for your Question.

You have to provide the <GeschichteContextProvider /> in your testing render tree.
Any hooks (e.g. useQuery etc) cannot be used without the Provider.

If you use history you can have an example how I did it for the library tests here:
https://github.com/BowlingX/geschichte/blob/master/src/__tests__/index.tsx#L101

According to your Feedback this error is now more clear in version 10.0.2.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by BowlingX
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants