2021-07-24 01:58:29 +02:00
|
|
|
import 'whatwg-fetch'
|
2022-06-06 12:50:13 +02:00
|
|
|
import 'jest-canvas-mock'
|
2021-11-23 17:22:05 +01:00
|
|
|
|
2024-01-15 08:44:43 +01:00
|
|
|
import { TextEncoder, TextDecoder } from 'util'
|
|
|
|
// Jest/JSDom don't know about TextEncoder but the browsers we support do
|
|
|
|
// https://github.com/jsdom/jsdom/issues/2524
|
|
|
|
global.TextDecoder = TextDecoder
|
|
|
|
global.TextEncoder = TextEncoder
|
|
|
|
|
2021-11-23 17:22:05 +01:00
|
|
|
window.scrollTo = jest.fn()
|
2023-08-16 16:06:09 +02:00
|
|
|
window.matchMedia = jest.fn(
|
|
|
|
() => ({ matches: false, addListener: jest.fn(), removeListener: jest.fn() } as MediaQueryList)
|
|
|
|
)
|