1
0
mirror of https://github.com/h3poteto/whalebird-desktop synced 2024-12-23 15:37:59 +01:00
Whalebird-desktop-client-ma.../spec/setupJest.ts

11 lines
378 B
TypeScript
Raw Normal View History

// 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
}