Skip to content

Commit 26f0f5c

Browse files
committed
tests: fix missing TextDecoder/Encoder in jest
1 parent 16c45f4 commit 26f0f5c

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

tests/utils.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { TextDecoder, TextEncoder } from 'node:util';
2+
13
import type { Poool } from 'poool-access';
24
import type { ReactNode } from 'react';
35
import puppeteer, { type LaunchOptions } from 'puppeteer';
@@ -9,6 +11,9 @@ import {
911
AuditContext,
1012
} from '../src/contexts';
1113

14+
globalThis.TextDecoder = TextDecoder;
15+
globalThis.TextEncoder = TextEncoder;
16+
1217
export const createBrowser = (opts?: LaunchOptions) =>
1318
puppeteer.launch({
1419
headless: !process.env.HEADFULL,

0 commit comments

Comments
 (0)