diff --git a/test-setup.ts b/test-setup.ts index 324b575..0278b6d 100644 --- a/test-setup.ts +++ b/test-setup.ts @@ -1,5 +1,7 @@ // context: https://github.com/testing-library/jest-dom/pull/511 import "@testing-library/jest-dom/vitest"; +import { cleanup } from "@testing-library/react"; +import { afterEach } from "vitest"; // TODO: figure out if this is still necessary: // @ts-expect-error ignore -- this solves issue where RTL throws this error "this environment not configured for act" @@ -13,3 +15,7 @@ global.matchMedia = removeListener: () => undefined, }; }; + +afterEach(() => { + cleanup(); +});