-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
test(react-query/useQueries): replace inline 'Promise' delays with 'sleep', and add 'expect' using 'toBeInTheDocument' #9466
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
…leep', and add 'expect' using 'toBeInTheDocument'
View your CI Pipeline Execution ↗ for commit 49e4cae
☁️ Nx Cloud last updated this comment at |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #9466 +/- ##
===========================================
+ Coverage 45.30% 84.38% +39.07%
===========================================
Files 208 26 -182
Lines 8283 365 -7918
Branches 1869 107 -1762
===========================================
- Hits 3753 308 -3445
+ Misses 4085 48 -4037
+ Partials 445 9 -436 🚀 New features to boost your workflow:
|
…delays-with-sleep
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.
Simple is best for me, if possible 😁
queryFn: async () => { | ||
if (id === 2) { | ||
await sleep(10) | ||
return Promise.reject(new Error('FAILURE')) | ||
} | ||
await sleep(10) | ||
return Promise.resolve({ id, title: `Post ${id}` }) | ||
}, |
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 is just a small thing I wanna make like this.
queryFn: async () => { | |
if (id === 2) { | |
await sleep(10) | |
return Promise.reject(new Error('FAILURE')) | |
} | |
await sleep(10) | |
return Promise.resolve({ id, title: `Post ${id}` }) | |
}, | |
queryFn: () => sleep(10).then(() => { | |
if(id === 2) throw new Error('FAILURE') | |
return { id, title: `Post ${id}` } | |
}), |
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.
I agree with you. I gonna reflect your suggestion. 👍
…ck properties of all observer case
No description provided.