diff --git a/src/__tests__/extensions/replay/sessionrecording.test.ts b/src/__tests__/extensions/replay/sessionrecording.test.ts index 281aa79ea..a11069bfe 100644 --- a/src/__tests__/extensions/replay/sessionrecording.test.ts +++ b/src/__tests__/extensions/replay/sessionrecording.test.ts @@ -613,13 +613,13 @@ describe('SessionRecording', () => { sessionRecording.startRecordingIfEnabled() - expect(sessionRecording['_captureStarted']).toEqual(true) + expect(sessionRecording.started).toEqual(true) expect(sessionRecording['stopRrweb']).not.toEqual(undefined) sessionRecording.stopRecording() expect(sessionRecording['stopRrweb']).toEqual(undefined) - expect(sessionRecording['_captureStarted']).toEqual(false) + expect(sessionRecording.started).toEqual(false) }) it('session recording can be turned on after being turned off', () => { @@ -627,13 +627,13 @@ describe('SessionRecording', () => { sessionRecording.startRecordingIfEnabled() - expect(sessionRecording['_captureStarted']).toEqual(true) + expect(sessionRecording.started).toEqual(true) expect(sessionRecording['stopRrweb']).not.toEqual(undefined) sessionRecording.stopRecording() expect(sessionRecording['stopRrweb']).toEqual(undefined) - expect(sessionRecording['_captureStarted']).toEqual(false) + expect(sessionRecording.started).toEqual(false) }) describe('console logs', () => { diff --git a/src/extensions/replay/sessionrecording.ts b/src/extensions/replay/sessionrecording.ts index 0185ba54c..4a1b08ef3 100644 --- a/src/extensions/replay/sessionrecording.ts +++ b/src/extensions/replay/sessionrecording.ts @@ -107,6 +107,11 @@ export class SessionRecording { private _sampleRate: number | null = null private _minimumDuration: number | null = null + public get started(): boolean { + // TODO could we use status instead of _captureStarted? + return this._captureStarted + } + private get sessionManager() { if (!this.instance.sessionManager) { logger.error('Session recording started without valid sessionManager')