From b417895a5f3f7442174c75db055070a977aa274c Mon Sep 17 00:00:00 2001 From: Pavel Meyer Date: Tue, 17 Dec 2024 15:38:22 +0300 Subject: [PATCH] Update setupTests.ts --- src/shared/utils/tests/setupTests.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/shared/utils/tests/setupTests.ts b/src/shared/utils/tests/setupTests.ts index b2fc3c38b7..84c60db4a3 100644 --- a/src/shared/utils/tests/setupTests.ts +++ b/src/shared/utils/tests/setupTests.ts @@ -1,4 +1,15 @@ // The order is important here! +import { TextDecoder, TextEncoder } from "util"; + +if (typeof global.TextDecoder === "undefined") { + (global as any).TextDecoder = TextDecoder; +} + +if (typeof global.TextEncoder === "undefined") { + global.TextEncoder = TextEncoder; +} + + import "./mockMatchMedia"; import "@/projectSetupImports"; import "./mockConfig";