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.