-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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): use fake timer for HydrationBoundary.test.tsx #8774
base: main
Are you sure you want to change the base?
test(react-query): use fake timer for HydrationBoundary.test.tsx #8774
Conversation
View your CI Pipeline Execution ↗ for commit 111293b.
☁️ Nx Cloud last updated this comment at |
2acf617
to
0308e17
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #8774 +/- ##
===========================================
+ Coverage 46.50% 84.18% +37.67%
===========================================
Files 199 26 -173
Lines 7560 373 -7187
Branches 1740 111 -1629
===========================================
- Hits 3516 314 -3202
+ Misses 3668 50 -3618
+ Partials 376 9 -367
🚀 New features to boost your workflow:
|
Array.from({ length: 1000 }).map(async (_, index) => { | ||
await vi.advanceTimersByTimeAsync(index) | ||
expect(hydrateSpy).toHaveBeenCalledTimes(0) | ||
}), | ||
) |
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.
what does this do?
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 wanted to test that hydrateSpy is not called over time.
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 think this is better
await vi.runAllTimersAsync()
expect(hydrateSpy).toHaveBeenCalledTimes(0)
…e-fake-timer-HydrationBoundary
No description provided.