-
Notifications
You must be signed in to change notification settings - Fork 91
Unit tests for useQuery #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Joezo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests look good 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good - a couple of things missing:
Testing theSorry, you do have that test, my bad.refetchfunction re-calls fetchData passingskipCache=true- Is it possible to verify the second argument to the useEffect
[query, JSON.stringify(opts.variables)]i.e. change the variables causes it to be re-called
|
@Joezo @bmullan91 thanks for the reviews. I've added the following three tests to cover the |
Joezo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks even better now 👍 🥇
bmullan91
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - nice work @jackdclark 😎
Part of #9
Add test coverage for
useQuery