Skip to content

Commit 129820f

Browse files
billyvgmydea
authored andcommitted
TextEncoder in global in jest setup
1 parent 9a76788 commit 129820f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/replay/jest.setup.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
22
import { getCurrentHub } from '@sentry/core';
33
import type { ReplayRecordingData, Transport } from '@sentry/types';
4+
import {TextEncoder} from 'util';
45

56
import type { ReplayContainer, Session } from './src/types';
67

78
// @ts-ignore TS error, this is replaced in prod builds bc of rollup
89
global.__SENTRY_REPLAY_VERSION__ = 'version:Test';
910

11+
(global as any).TextEncoder = TextEncoder;
12+
1013
type MockTransport = jest.MockedFunction<Transport['send']>;
1114

1215
jest.mock('./src/util/isBrowser', () => {

0 commit comments

Comments
 (0)