From 45bdf431508eaaf5fc16f4419d124671aaea9fcb Mon Sep 17 00:00:00 2001 From: CHOMPStation2StaffMirrorBot <94713762+CHOMPStation2StaffMirrorBot@users.noreply.github.com> Date: Thu, 23 Jul 2026 13:56:05 -0700 Subject: [PATCH] [MIRROR] fix multiple tests leaking dom into each other (#12925) Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com> --- tgui/happydom.ts | 7 ++++++- tgui/tsconfig.json | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/tgui/happydom.ts b/tgui/happydom.ts index 225eab0aac..a5ca6988a3 100644 --- a/tgui/happydom.ts +++ b/tgui/happydom.ts @@ -1,5 +1,10 @@ +import { afterEach } from 'bun:test'; import { GlobalRegistrator } from '@happy-dom/global-registrator'; GlobalRegistrator.register(); -import './packages/tgui/__mocks__/setup.ts'; +const { cleanup } = await import('@testing-library/react'); + +afterEach(cleanup); + +import './packages/tgui/__mocks__/setup'; diff --git a/tgui/tsconfig.json b/tgui/tsconfig.json index 7b792ad4c5..05fbb76a62 100644 --- a/tgui/tsconfig.json +++ b/tgui/tsconfig.json @@ -28,5 +28,5 @@ "strictNullChecks": true, "target": "ESNext" }, - "include": ["./*.d.ts", "./packages"] + "include": ["./*.d.ts", "./packages", "happydom.ts"] }