@@ -14,6 +14,7 @@ import { ReplayContainer } from '../../src/replay';
1414import type { RecordingEvent } from '../../src/types' ;
1515import { addEvent } from '../../src/util/addEvent' ;
1616import { createPerformanceSpans } from '../../src/util/createPerformanceSpans' ;
17+ import { clearSession } from '../utils/clearSession' ;
1718import { useFakeTimers } from '../utils/use-fake-timers' ;
1819import { PerformanceEntryResource } from './../fixtures/performanceEntry/resource' ;
1920import { BASE_TIMESTAMP , RecordMock } from './../index' ;
@@ -128,7 +129,7 @@ describe('Replay', () => {
128129
129130 // Create a new session and clear mocks because a segment (from initial
130131 // checkout) will have already been uploaded by the time the tests run
131- replay . clearSession ( ) ;
132+ clearSession ( replay ) ;
132133 replay . loadSession ( { expiry : 0 } ) ;
133134 mockTransportSend . mockClear ( ) ;
134135 mockSendReplayRequest = replay . sendReplayRequest as MockSendReplayRequest ;
@@ -142,7 +143,7 @@ describe('Replay', () => {
142143 value : prevLocation ,
143144 writable : true ,
144145 } ) ;
145- replay . clearSession ( ) ;
146+ clearSession ( replay ) ;
146147 jest . clearAllMocks ( ) ;
147148 mockSendReplayRequest . mockRestore ( ) ;
148149 mockRecord . takeFullSnapshot . mockClear ( ) ;
@@ -159,7 +160,7 @@ describe('Replay', () => {
159160 } ) ;
160161
161162 it ( 'clears session' , ( ) => {
162- replay . clearSession ( ) ;
163+ clearSession ( replay ) ;
163164 expect ( WINDOW . sessionStorage . getItem ( REPLAY_SESSION_KEY ) ) . toBe ( null ) ;
164165 expect ( replay . session ) . toBe ( undefined ) ;
165166 } ) ;
@@ -750,7 +751,7 @@ describe('Replay', () => {
750751 } ) ;
751752
752753 it ( 'has correct timestamps when there events earlier than initial timestamp' , async function ( ) {
753- replay . clearSession ( ) ;
754+ clearSession ( replay ) ;
754755 replay . loadSession ( { expiry : 0 } ) ;
755756 mockTransportSend . mockClear ( ) ;
756757 Object . defineProperty ( document , 'visibilityState' , {
0 commit comments