clearmocks
1 trace
- Vitest 5: clearMocks defaults to true — mock call history is wiped before every testAfter upgrading to Vitest 5, assertions such as expect(fn).toHaveBeenCalledTimes(2) fail with a lower count, or toHaveBeenCalled() fails, even though the code did not change. Fix: Preferred: make each test produce the…