vitest-retry-testing-real-vs-fake-timers
CommunityStabilize Vitest retry tests with real timers.
AuthorHankanman
Version1.0.0
Installs0
System Documentation
What problem does it solve?
This skill helps developers stabilize Vitest-based retry logic by comparing real timers against fake timers and avoiding flaky outcomes caused by timer coordination issues.
Core Features & Use Cases
- Real timers for retry tests: Use real timers for small delays to ensure microtask/macrotask coordination behaves as in production.
- Safe fake-timer workflows: When necessary, use fake timers with careful microtask management and async timer APIs to prevent PromiseRejectionHandledWarning.
- Guided migration patterns: Provides step-by-step migration guidance for common retry utilities, rate limiters, and backoff strategies to reduce flakiness.
Quick Start
Remove vi.useFakeTimers() and rely on real timers for fast, reliable tests. If you must use fake timers, follow the microtask-flush pattern and advanceTimersByTimeAsync with explicit awaits to ensure promises settle before assertions.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: vitest-retry-testing-real-vs-fake-timers Download link: https://github.com/Hankanman/claude-config/archive/main.zip#vitest-retry-testing-real-vs-fake-timers Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.