You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
naifu-frontend/config/jest/setup.ts

21 lines
609 B
TypeScript

import '@testing-library/jest-dom/extend-expect'
import { webcrypto } from 'crypto'
import { TextEncoder, TextDecoder } from 'util'
import { jest } from '@jest/globals'
const globals: any = global
globals.crypto = webcrypto
globals.TextEncoder = TextEncoder
globals.TextDecoder = TextDecoder
if (!globals.window) {
globals.window = {}
jest.mock('recoil')
}
if (!globals.document) {
globals.document = globals.document || {}
globals.document.documentElement = globals.document.documentElement || {}
globals.document.documentElement.style = globals.document.documentElement.style || {}
}