-
Notifications
You must be signed in to change notification settings - Fork 510
test(compat/defer): Replace deprecated done() callback with fake timers in async tests #1360
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?
Conversation
- Vitest says `done()` callback is deprecated, so I replaced it with fake timer.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Pull Request Overview
This PR modernizes Vitest test implementation by replacing deprecated done() callback patterns with fake timers for asynchronous testing.
- Replaced deprecated
done()callback usage withvi.useFakeTimers()andvi.advanceTimersByTime() - Added proper test setup and teardown with
beforeEachandafterEachhooks - Simplified async test logic by eliminating callback-based patterns
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1360 +/- ##
=======================================
Coverage 99.97% 99.97%
=======================================
Files 468 468
Lines 4459 4459
Branches 1313 1313
=======================================
Hits 4458 4458
Misses 1 1 🚀 New features to boost your workflow:
|
Problem
Deprecation warning occurs when using the
done()callback in Vitest testsSolution
Replaced Vitest's deprecated
done()callback with fake timersBefore
After