Five tests restore fake timers only at the end of their body, so a failed assertion left fake timers to the next test in the same file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
11 lines
310 B
TypeScript
11 lines
310 B
TypeScript
import "@testing-library/jest-dom/vitest";
|
|
import { cleanup } from "@testing-library/react";
|
|
import { afterEach, vi } from "vitest";
|
|
|
|
afterEach(() => {
|
|
cleanup();
|
|
// A test that fails before its own vi.useRealTimers() must not leave fake
|
|
// timers to the next test in the file.
|
|
vi.useRealTimers();
|
|
});
|