From 5a44c3126dc19ce61820fb9e5eb77a292cb01cab Mon Sep 17 00:00:00 2001 From: Jakob Schwehn Date: Mon, 16 Dec 2024 15:37:03 +0100 Subject: [PATCH] lint: require -> import --- src/setupTests.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/setupTests.ts b/src/setupTests.ts index d23736b69d..12c895eff4 100644 --- a/src/setupTests.ts +++ b/src/setupTests.ts @@ -4,10 +4,12 @@ // learn more: https://github.com/testing-library/jest-dom import "@testing-library/jest-dom"; +import {TextEncoder} from "util"; + global.ResizeObserver = require("resize-observer-polyfill"); // global.TextDecoder = require('util').TextDecoder; -global.TextEncoder = require("util").TextEncoder; +global.TextEncoder = TextEncoder; // jest can't handle match media, and the official workaround doesn't work (lol): // https://jestjs.io/docs/manual-mocks#mocking-methods-which-are-not-implemented-in-jsdom