mirror of
https://github.com/oven-sh/bun
synced 2026-02-13 04:18:58 +00:00
Adds support for Vitest timer mocking methods to control Date behavior in tests: - vi.useFakeTimers() - Freezes Date to current time when called - vi.useRealTimers() - Restores real Date behavior - vi.setSystemTime(date) - Sets mocked Date to specific time (accepts number/Date/string) When fake timers are enabled, Date.now() and new Date() return the mocked time value. The implementation uses globalObject->overridenDateNow to control the Date behavior. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>