You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[CLAUDE ROUTINE]: Test-coverage enhancement — wrap vi.useFakeTimers/useRealTimers in try/finally (or afterEach) to prevent leaking fake timers across tests #173
__tests__/components/copy-button.test.tsx enables fake timers inside a test body and restores real timers at the end of the same body. If the test throws between the two calls (an assertion failure, an unhandled promise rejection, …), real timers are never restored and every subsequent test in the same worker runs with fake timers still active — the classic "one red test turns the rest red" flakiness pattern.
Where
__tests__/components/copy-button.test.tsx (around the it(... 'shows copied state for 1.5s' ...) block)
vi.useFakeTimers({shouldAdvanceTime: true});render(<CopyButtontext="test"/>);// ← if this block throws, real timers are never restoredvi.useRealTimers();
Why this helps users
Clean CI signal — a single flake stops cascading into spurious failures in later tests, making the test job (one of the four CI jobs) more trustworthy.
Faster triage — when a timer assertion fails, the next test's unrelated error no longer distracts the person on-call.
Activity