Skip to content

Commit 9a76788

Browse files
billyvgmydea
authored andcommitted
Revert "fix integration tests, need to provide TextEncoder in global"
This reverts commit 7157ef2.
1 parent e9a8d98 commit 9a76788

File tree

9 files changed

+0
-36
lines changed

9 files changed

+0
-36
lines changed

packages/replay/test/integration/autoSaveSession.test.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { EventType } from 'rrweb';
2-
import { TextEncoder } from 'util';
32

43
import type { RecordingEvent } from '../../src/types';
54
import { addEvent } from '../../src/util/addEvent';
@@ -9,10 +8,6 @@ import { useFakeTimers } from '../utils/use-fake-timers';
98
useFakeTimers();
109

1110
describe('Integration | autoSaveSession', () => {
12-
beforeAll(() => {
13-
(global as any).TextEncoder = TextEncoder;
14-
});
15-
1611
afterEach(() => {
1712
jest.clearAllMocks();
1813
});

packages/replay/test/integration/coreHandlers/handleGlobalEvent.test.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { getCurrentHub } from '@sentry/core';
22
import type { Event } from '@sentry/types';
3-
import { TextEncoder } from 'util';
43

54
import { REPLAY_EVENT_NAME } from '../../../src/constants';
65
import { handleGlobalEventListener } from '../../../src/coreHandlers/handleGlobalEvent';
@@ -18,10 +17,6 @@ useFakeTimers();
1817
let replay: ReplayContainer;
1918

2019
describe('Integration | coreHandlers | handleGlobalEvent', () => {
21-
beforeAll(() => {
22-
(global as any).TextEncoder = TextEncoder;
23-
});
24-
2520
beforeEach(async () => {
2621
({ replay } = await resetSdkMock({
2722
replayOptions: {

packages/replay/test/integration/errorSampleRate.test.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { captureException } from '@sentry/core';
2-
import { TextEncoder } from 'util';
32

43
import { DEFAULT_FLUSH_MIN_DELAY, REPLAY_SESSION_KEY, VISIBILITY_CHANGE_TIMEOUT, WINDOW } from '../../src/constants';
54
import type { ReplayContainer } from '../../src/replay';
@@ -24,10 +23,6 @@ describe('Integration | errorSampleRate', () => {
2423
let mockRecord: RecordMock;
2524
let domHandler: DomHandler;
2625

27-
beforeAll(() => {
28-
(global as any).TextEncoder = TextEncoder;
29-
});
30-
3126
beforeEach(async () => {
3227
({ mockRecord, domHandler, replay } = await resetSdkMock({
3328
replayOptions: {

packages/replay/test/integration/eventProcessors.test.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { getCurrentHub } from '@sentry/core';
22
import type { Event, Hub, Scope } from '@sentry/types';
3-
import { TextEncoder } from 'util';
43

54
import { BASE_TIMESTAMP } from '..';
65
import { resetSdkMock } from '../mocks/resetSdkMock';
@@ -12,10 +11,6 @@ describe('Integration | eventProcessors', () => {
1211
let hub: Hub;
1312
let scope: Scope;
1413

15-
beforeAll(() => {
16-
(global as any).TextEncoder = TextEncoder;
17-
});
18-
1914
beforeEach(() => {
2015
hub = getCurrentHub();
2116
scope = hub.pushScope();

packages/replay/test/integration/events.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { getCurrentHub } from '@sentry/core';
2-
import { TextEncoder } from 'util';
32

43
import { WINDOW } from '../../src/constants';
54
import type { ReplayContainer } from '../../src/replay';
@@ -25,7 +24,6 @@ describe('Integration | events', () => {
2524
const prevLocation = WINDOW.location;
2625

2726
beforeAll(async () => {
28-
(global as any).TextEncoder = TextEncoder;
2927
jest.setSystemTime(new Date(BASE_TIMESTAMP));
3028
jest.runAllTimers();
3129
});

packages/replay/test/integration/sendReplayEvent.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import * as SentryCore from '@sentry/core';
22
import type { Transport } from '@sentry/types';
33
import * as SentryUtils from '@sentry/utils';
4-
import { TextEncoder } from 'util';
54

65
import { DEFAULT_FLUSH_MIN_DELAY, SESSION_IDLE_DURATION, WINDOW } from '../../src/constants';
76
import type { ReplayContainer } from '../../src/replay';
@@ -28,7 +27,6 @@ describe('Integration | sendReplayEvent', () => {
2827
const { record: mockRecord } = mockRrweb();
2928

3029
beforeAll(async () => {
31-
(global as any).TextEncoder = TextEncoder;
3230
jest.setSystemTime(new Date(BASE_TIMESTAMP));
3331
jest.spyOn(SentryUtils, 'addInstrumentationHandler').mockImplementation((type, handler: (args: any) => any) => {
3432
if (type === 'dom') {

packages/replay/test/integration/session.test.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { getCurrentHub } from '@sentry/core';
22
import type { Transport } from '@sentry/types';
3-
import { TextEncoder } from 'util';
43

54
import {
65
DEFAULT_FLUSH_MIN_DELAY,
@@ -32,10 +31,6 @@ describe('Integration | session', () => {
3231
let domHandler: (args: any) => any;
3332
let mockRecord: RecordMock;
3433

35-
beforeAll(() => {
36-
(global as any).TextEncoder = TextEncoder;
37-
});
38-
3934
beforeEach(async () => {
4035
({ mockRecord, domHandler, replay } = await resetSdkMock({
4136
replayOptions: {

packages/replay/test/integration/stop.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import * as SentryUtils from '@sentry/utils';
2-
import { TextEncoder } from 'util';
32

43
import type { Replay } from '../../src';
54
import { SESSION_IDLE_DURATION, WINDOW } from '../../src/constants';
@@ -23,7 +22,6 @@ describe('Integration | stop', () => {
2322
let mockAddInstrumentationHandler: MockAddInstrumentationHandler;
2423

2524
beforeAll(async () => {
26-
(global as any).TextEncoder = TextEncoder;
2725
jest.setSystemTime(new Date(BASE_TIMESTAMP));
2826
mockAddInstrumentationHandler = jest.spyOn(
2927
SentryUtils,

packages/replay/test/unit/util/createReplayEnvelope.test.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import type { ReplayEvent } from '@sentry/types';
22
import { makeDsn } from '@sentry/utils';
3-
import { TextEncoder } from 'util';
43

54
import { createReplayEnvelope } from '../../../src/util/createReplayEnvelope';
65

@@ -42,10 +41,6 @@ describe('Unit | util | createReplayEnvelope', () => {
4241
publicKey: 'abc',
4342
});
4443

45-
beforeAll(() => {
46-
(global as any).TextEncoder = TextEncoder;
47-
});
48-
4944
it('creates an envelope for a given Replay event', () => {
5045
const envelope = createReplayEnvelope(replayEvent, payloadWithSequence, dsn);
5146

0 commit comments

Comments
 (0)