Skip to content

Conversation

@miinhho
Copy link
Contributor

@miinhho miinhho commented Aug 23, 2025

Problem

Deprecation warning occurs when using the done() callback in Vitest tests

Solution

Replaced Vitest's deprecated done() callback with fake timers

Before

Screenshot 2025-08-24 011347 Screenshot 2025-08-24 011334

After

image

- Vitest says `done()` callback is deprecated, so I replaced it with fake timer.
Copilot AI review requested due to automatic review settings August 23, 2025 16:31
@vercel
Copy link

vercel bot commented Aug 23, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
es-toolkit Ready Ready Preview Comment Oct 29, 2025 4:45pm

Copy link
Contributor

Copilot AI left a 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 with vi.useFakeTimers() and vi.advanceTimersByTime()
  • Added proper test setup and teardown with beforeEach and afterEach hooks
  • 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-commenter
Copy link

codecov-commenter commented Aug 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.88%. Comparing base (2687388) to head (efffda2).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1360   +/-   ##
=======================================
  Coverage   99.88%   99.88%           
=======================================
  Files         468      468           
  Lines        4453     4453           
  Branches     1311     1311           
=======================================
  Hits         4448     4448           
  Misses          5        5           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants