diff --git a/src/shared/utils/tests/setupTests.ts b/src/shared/utils/tests/setupTests.ts index b2fc3c38b..84c60db4a 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";