1
0
mirror of https://github.com/h3poteto/whalebird-desktop synced 2024-12-29 10:13:36 +01:00
Whalebird-desktop-client-ma.../spec/setupJest.ts
2021-12-30 00:17:23 +09:00

11 lines
378 B
TypeScript

// This code is to resolve errors on tootParser.spec.
// TextEncoder and TextDecoder are used in jsdom, but these object is defined in Browser js.
import { TextEncoder, TextDecoder } from 'util'
if (typeof global.TextEncoder === 'undefined') {
global.TextEncoder = TextEncoder
}
if (typeof global.TextDecoder === 'undefined') {
;(global.TextDecoder as any) = TextDecoder
}