Skip to content

Commit cc945f2

Browse files
committed
fix tests for real
1 parent ab66c33 commit cc945f2

File tree

5 files changed

+12
-13
lines changed

5 files changed

+12
-13
lines changed

packages/replay/src/integration.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,13 @@ export const replayIntegration = ((options?: ReplayConfiguration) => {
4848
return new Replay(options);
4949
}) satisfies IntegrationFn;
5050

51-
// TODO: Rewrite this to be functional integration
52-
class Replay implements Integration {
51+
/**
52+
* Replay integration
53+
*
54+
* TODO: Rewrite this to be functional integration
55+
* Exported for tests.
56+
*/
57+
export class Replay implements Integration {
5358
/**
5459
* @inheritDoc
5560
*/
@@ -127,7 +132,6 @@ class Replay implements Integration {
127132
// eslint-disable-next-line deprecation/deprecation
128133
ignoreClass,
129134
}: ReplayConfiguration = {}) {
130-
// eslint-disable-next-line deprecation/deprecation
131135
this.name = Replay.id;
132136

133137
const privacyOptions = getPrivacyOptions({

packages/replay/test/integration/beforeAddRecordingEvent.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as SentryCore from '@sentry/core';
22
import type { Transport } from '@sentry/types';
33
import * as SentryUtils from '@sentry/utils';
44

5-
import type { Replay } from '../../src';
5+
import type { Replay } from '../../src/integration';
66
import type { ReplayContainer } from '../../src/replay';
77
import { clearSession } from '../../src/session/clearSession';
88
import { createPerformanceEntries } from '../../src/util/createPerformanceEntries';
@@ -23,7 +23,6 @@ type MockTransportSend = jest.MockedFunction<Transport['send']>;
2323

2424
describe('Integration | beforeAddRecordingEvent', () => {
2525
let replay: ReplayContainer;
26-
// eslint-disable-next-line deprecation/deprecation
2726
let integration: Replay;
2827
let mockTransportSend: MockTransportSend;
2928
let mockSendReplayRequest: jest.SpyInstance<any>;

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as SentryUtils from '@sentry/utils';
22

3-
import type { Replay } from '../../src';
43
import { WINDOW } from '../../src/constants';
4+
import type { Replay } from '../../src/integration';
55
import type { ReplayContainer } from '../../src/replay';
66
import { clearSession } from '../../src/session/clearSession';
77
import { addEvent } from '../../src/util/addEvent';
@@ -17,7 +17,6 @@ type MockRunFlush = jest.MockedFunction<ReplayContainer['_runFlush']>;
1717

1818
describe('Integration | stop', () => {
1919
let replay: ReplayContainer;
20-
// eslint-disable-next-line deprecation/deprecation
2120
let integration: Replay;
2221
const prevLocation = WINDOW.location;
2322

packages/replay/test/mocks/mockSdk.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { Envelope, Transport, TransportMakeRequestResponse } from '@sentry/types';
22

3-
import type { Replay as ReplayIntegration } from '../../src';
3+
import type { Replay as ReplayIntegration } from '../../src/integration';
44
import type { ReplayContainer } from '../../src/replay';
55
import type { ReplayConfiguration } from '../../src/types';
66
import type { TestClientOptions } from '../utils/TestClient';
@@ -46,11 +46,9 @@ class MockTransport implements Transport {
4646

4747
export async function mockSdk({ replayOptions, sentryOptions, autoStart = true }: MockSdkParams = {}): Promise<{
4848
replay: ReplayContainer;
49-
// eslint-disable-next-line deprecation/deprecation
5049
integration: ReplayIntegration;
5150
}> {
52-
// eslint-disable-next-line deprecation/deprecation
53-
const { Replay } = await import('../../src');
51+
const { Replay } = await import('../../src/integration');
5452

5553
// Scope this to the test, instead of the module
5654
let _initialized = false;

packages/replay/test/mocks/resetSdkMock.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { EventProcessor } from '@sentry/types';
22
import { getGlobalSingleton, resetInstrumentationHandlers } from '@sentry/utils';
33

4-
import type { Replay as ReplayIntegration } from '../../src';
4+
import type { Replay as ReplayIntegration } from '../../src/integration';
55
import type { ReplayContainer } from '../../src/replay';
66
import type { RecordMock } from './../index';
77
import { BASE_TIMESTAMP } from './../index';
@@ -13,7 +13,6 @@ export async function resetSdkMock({ replayOptions, sentryOptions, autoStart }:
1313
domHandler: DomHandler;
1414
mockRecord: RecordMock;
1515
replay: ReplayContainer;
16-
// eslint-disable-next-line deprecation/deprecation
1716
integration: ReplayIntegration;
1817
}> {
1918
let domHandler: DomHandler;

0 commit comments

Comments
 (0)