-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
stabilize the test for notifying query cache when a query becomes stale #4466
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
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 37be96d:
|
| // 7. Observer options updated | ||
| // 8. Observer result updated -> stale | ||
| // 9. Observer options updated | ||
| expect(fn).toHaveBeenCalledTimes(9) |
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.
the comments about the "9 updates" is still here, but the assertion is gone 🤔
I also don't know what the states.push are actually doing here. Nothing it seems.
I think this is one of the tests that should actually live in the query-core, not react-query. There is no nothing react specific about should notify query cache when a query becomes stale
we could do:
- subscribe to queryCache
- create an observer with a staleTime
- do the same checks there ...
this would also get rid of the test duplication in solidJs
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.
All right, I'll give that a try
Codecov ReportBase: 96.36% // Head: 92.47% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #4466 +/- ##
==========================================
- Coverage 96.36% 92.47% -3.89%
==========================================
Files 45 88 +43
Lines 2281 3575 +1294
Branches 640 926 +286
==========================================
+ Hits 2198 3306 +1108
- Misses 80 253 +173
- Partials 3 16 +13 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
…es stale - attempt#3 (thanks TkDodo)
No description provided.