-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
test(react-query-persist-client/PersistQueryClientProvider): replace 'await sleep' with 'sleep().then()' pattern in restoreClient and add additional timer advance for refetch verification #9901
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
base: main
Are you sure you want to change the base?
test(react-query-persist-client/PersistQueryClientProvider): replace 'await sleep' with 'sleep().then()' pattern in restoreClient and add additional timer advance for refetch verification #9901
Conversation
β¦'await sleep' with 'sleep().then()' pattern in restoreClient and add additional timer advance for refetch verification
|
WalkthroughA test file for Changes
Estimated code review effortπ― 2 (Simple) | β±οΈ ~8 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touchesβ Passed checks (3 passed)
β¨ Finishing touches
π§ͺ Generate unit tests (beta)
π Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro π Files selected for processing (1)
π§° Additional context usedπ§ Learnings (2)π Common learningsπ Learning: 2025-11-22T09:06:05.219ZApplied to files:
π Additional comments (2)
Comment |
|
View your CI Pipeline Execution β for commit ecc6a51
βοΈ Nx Cloud last updated this comment at |
Codecov Reportβ
All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9901 +/- ##
============================================
+ Coverage 45.70% 100.00% +54.29%
============================================
Files 200 1 -199
Lines 8437 18 -8419
Branches 1936 2 -1934
============================================
- Hits 3856 18 -3838
+ Misses 4133 0 -4133
+ Partials 448 0 -448 π New features to boost your workflow:
|
| await sleep(10) | ||
| throw error | ||
| return sleep(10).then(() => { | ||
| throw error | ||
| }) |
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.
same question: why? are there any functional difference ?
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.
@TkDodo If we apply the pattern from #9900 (comment), we could write it like this:
return sleep(10).then(() => Promise.reject(error))What do you think about this approach?
π― Changes
β Checklist
pnpm run test:pr.π Release Impact
Summary by CodeRabbit
Tests
Bug Fixes
βοΈ Tip: You can customize this high-level summary in your review settings.