From ce47babc60e7272d0f858612472b19e705fd0640 Mon Sep 17 00:00:00 2001 From: Drew Hoover Date: Mon, 11 Mar 2024 15:41:51 -0400 Subject: [PATCH] add cleanup back --- test-setup.ts | 6 ++++++ 1 file changed, 6 insertions(+) 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(); +});