@@ -698,15 +698,15 @@ describe('SessionReplay', () => {
698698 } ) ;
699699 } ) ;
700700
701- describe ( 'captureEventsIfShould ' , ( ) => {
701+ describe ( 'captureEvents ' , ( ) => {
702702 test ( 'should return early if no config' , async ( ) => {
703703 await sessionReplay . init ( apiKey , mockOptions ) . promise ;
704704 const createEventsIDBStoreInstance = await ( SessionReplayIDB . createEventsIDBStore as jest . Mock ) . mock . results [ 0 ]
705705 . value ;
706706
707707 record . mockReset ( ) ;
708708 sessionReplay . config = undefined ;
709- sessionReplay . captureEventsIfShould ( ) ;
709+ sessionReplay . captureEvents ( ) ;
710710 expect ( record ) . not . toHaveBeenCalled ( ) ;
711711 if ( ! sessionReplay . eventsManager ) {
712712 throw new Error ( 'Did not call init' ) ;
@@ -718,7 +718,7 @@ describe('SessionReplay', () => {
718718 await sessionReplay . init ( apiKey , mockOptions ) . promise ;
719719 record . mockReset ( ) ;
720720 sessionReplay . identifiers = undefined ;
721- sessionReplay . captureEventsIfShould ( ) ;
721+ sessionReplay . captureEvents ( ) ;
722722 expect ( record ) . not . toHaveBeenCalled ( ) ;
723723 } ) ;
724724
@@ -727,7 +727,7 @@ describe('SessionReplay', () => {
727727 . promise ;
728728 const createEventsIDBStoreInstance = await ( SessionReplayIDB . createEventsIDBStore as jest . Mock ) . mock . results [ 0 ]
729729 . value ;
730- sessionReplay . captureEventsIfShould ( ) ;
730+ sessionReplay . captureEvents ( ) ;
731731 expect ( record ) . not . toHaveBeenCalled ( ) ;
732732 if ( ! sessionReplay . eventsManager ) {
733733 throw new Error ( 'Did not call init' ) ;
@@ -740,7 +740,7 @@ describe('SessionReplay', () => {
740740 await sessionReplay . init ( apiKey , mockOptions ) . promise ;
741741 const createEventsIDBStoreInstance = await ( SessionReplayIDB . createEventsIDBStore as jest . Mock ) . mock . results [ 0 ]
742742 . value ;
743- sessionReplay . captureEventsIfShould ( ) ;
743+ sessionReplay . captureEvents ( ) ;
744744 if ( ! sessionReplay . eventsManager ) {
745745 throw new Error ( 'Did not call init' ) ;
746746 }
@@ -762,7 +762,7 @@ describe('SessionReplay', () => {
762762 await sessionReplay . init ( apiKey , mockOptions ) . promise ;
763763 const createEventsIDBStoreInstance = await ( SessionReplayIDB . createEventsIDBStore as jest . Mock ) . mock . results [ 0 ]
764764 . value ;
765- sessionReplay . captureEventsIfShould ( ) ;
765+ sessionReplay . captureEvents ( ) ;
766766 const stopRecordingMock = jest . fn ( ) ;
767767 sessionReplay . recordCancelCallback = stopRecordingMock ;
768768 if ( ! sessionReplay . eventsManager ) {
@@ -788,7 +788,7 @@ describe('SessionReplay', () => {
788788
789789 test ( 'should add an error handler' , async ( ) => {
790790 await sessionReplay . init ( apiKey , mockOptions ) . promise ;
791- sessionReplay . captureEventsIfShould ( ) ;
791+ sessionReplay . captureEvents ( ) ;
792792 const recordArg = record . mock . calls [ 0 ] [ 0 ] ;
793793 const errorHandlerReturn = recordArg ?. errorHandler && recordArg ?. errorHandler ( new Error ( 'test error' ) ) ;
794794 // eslint-disable-next-line @typescript-eslint/unbound-method
@@ -799,7 +799,7 @@ describe('SessionReplay', () => {
799799 test ( 'should rethrow CSSStylesheet errors' , async ( ) => {
800800 const sessionReplay = new SessionReplay ( ) ;
801801 await sessionReplay . init ( apiKey , mockOptions ) . promise ;
802- sessionReplay . captureEventsIfShould ( ) ;
802+ sessionReplay . captureEvents ( ) ;
803803 const recordArg = record . mock . calls [ 0 ] [ 0 ] ;
804804 const stylesheetErrorMessage =
805805 "Failed to execute 'insertRule' on 'CSSStyleSheet': Failed to parse the rule 'body::-ms-expand{display: none}" ;
@@ -811,7 +811,7 @@ describe('SessionReplay', () => {
811811 test ( 'should rethrow external errors' , async ( ) => {
812812 const sessionReplay = new SessionReplay ( ) ;
813813 await sessionReplay . init ( apiKey , mockOptions ) . promise ;
814- sessionReplay . captureEventsIfShould ( ) ;
814+ sessionReplay . captureEvents ( ) ;
815815 const recordArg = record . mock . calls [ 0 ] [ 0 ] ;
816816 const error = new Error ( 'test' ) as Error & { _external_ ?: boolean } ;
817817 error . _external_ = true ;
0 commit comments