-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
test(react-query/suspense): add test cases for 'static' staleTime with number and function #10089
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
test(react-query/suspense): add test cases for 'static' staleTime with number and function #10089
Conversation
…h number and function
|
📝 WalkthroughWalkthroughType import added for StaleTime from query-core. Updated staleTime parameter type signature in createTestQuery to use StaleTime type. Two new test cases introduced to verify staleTime caching behavior with string literals and function returns. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Important Action Needed: IP Allowlist UpdateIf your organization protects your Git platform with IP whitelisting, please add the new CodeRabbit IP address to your allowlist:
Failure to add the new IP will result in interrupted reviews. Comment |
|
View your CI Pipeline Execution ↗ for commit f3588c5
☁️ Nx Cloud last updated this comment at |
🎯 Changes
Add test cases for
'static'staleTimeinensureSuspenseTimersto cover theclampbranch that preserves'static'value as-is.staleTime: 'static'(number type)staleTime: () => 'static'(function type)StaleTimetype from@tanstack/query-coreinstead of inline type✅ Checklist
pnpm run test:pr.🚀 Release Impact
Summary by CodeRabbit
staleTimeconfiguration is correctly preserved when using static values and function-based approaches, ensuring proper cache behavior across different input types.