mirror of
https://github.com/PostHog/posthog.git
synced 2024-11-21 13:39:22 +01:00
f236e2513a
* fix: cannot read body twice * only read it once no matter what * fix tests but yucky * nicer * does this mean backend checks won't incorrectly run * comment
14 lines
443 B
TypeScript
14 lines
443 B
TypeScript
import 'whatwg-fetch'
|
|
import 'jest-canvas-mock'
|
|
|
|
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
|
|
|
|
window.scrollTo = jest.fn()
|
|
window.matchMedia = jest.fn(
|
|
() => ({ matches: false, addListener: jest.fn(), removeListener: jest.fn() } as MediaQueryList)
|
|
)
|