Skip to content

Commit cb65595

Browse files
committed
fix mock
1 parent 45e4156 commit cb65595

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

packages/replay/jest.setup.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import { getCurrentHub } from '@sentry/core';
33
import type { ReplayRecordingData, Transport } from '@sentry/types';
44
import { TextEncoder } from 'util';
5+
import * as SentryUtils from '@sentry/utils';
56

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

@@ -10,13 +11,7 @@ import type { ReplayContainer, Session } from './src/types';
1011

1112
type MockTransport = jest.MockedFunction<Transport['send']>;
1213

13-
jest.mock('@sentry/utils', () => {
14-
const original = jest.requireActual('@sentry/utils');
15-
return {
16-
...original,
17-
isBrowser: () => true,
18-
};
19-
});
14+
jest.spyOn(SentryUtils, 'isBrowser').mockImplementation(() => true);
2015

2116
type EnvelopeHeader = {
2217
event_id: string;

0 commit comments

Comments
 (0)