File tree Expand file tree Collapse file tree 3 files changed +35
-2
lines changed Expand file tree Collapse file tree 3 files changed +35
-2
lines changed Original file line number Diff line number Diff line change 1111### Fixes
1212
1313- Add more expressive debug logs to Native Frames Integration ([ #3880 ] ( https://github.com/getsentry/sentry-react-native/pull/3880 ) )
14+ - Add missing tracing integrations when using ` client.init() ` ([ #3882 ] ( https://github.com/getsentry/sentry-react-native/pull/3882 ) )
1415
1516### Dependencies
1617
Original file line number Diff line number Diff line change @@ -109,8 +109,8 @@ export class ReactNativeClient extends BaseClient<ReactNativeClientOptions> {
109109 /**
110110 * Sets up the integrations
111111 */
112- public setupIntegrations ( ) : void {
113- super . setupIntegrations ( ) ;
112+ protected _setupIntegrations ( ) : void {
113+ super . _setupIntegrations ( ) ;
114114 const tracing = this . getIntegration ( ReactNativeTracing ) ;
115115 const routingName = tracing ?. options . routingInstrumentation ?. name ;
116116 if ( routingName ) {
Original file line number Diff line number Diff line change @@ -667,6 +667,22 @@ describe('Tests ReactNativeClient', () => {
667667 expect ( client . getIntegrationById ( 'ReactNativeUserInteractionTracing' ) ) . toBeTruthy ( ) ;
668668 } ) ;
669669
670+ test ( 'register user interactions tracing - init()' , ( ) => {
671+ const client = new ReactNativeClient (
672+ mockedOptions ( {
673+ dsn : EXAMPLE_DSN ,
674+ integrations : [
675+ new ReactNativeTracing ( {
676+ enableUserInteractionTracing : true ,
677+ } ) ,
678+ ] ,
679+ } ) ,
680+ ) ;
681+ client . init ( ) ;
682+
683+ expect ( client . getIntegrationById ( 'ReactNativeUserInteractionTracing' ) ) . toBeTruthy ( ) ;
684+ } ) ;
685+
670686 test ( 'do not register user interactions tracing' , ( ) => {
671687 const client = new ReactNativeClient (
672688 mockedOptions ( {
@@ -682,6 +698,22 @@ describe('Tests ReactNativeClient', () => {
682698
683699 expect ( client . getIntegrationById ( 'ReactNativeUserInteractionTracing' ) ) . toBeUndefined ( ) ;
684700 } ) ;
701+
702+ test ( 'do not register user interactions tracing - init()' , ( ) => {
703+ const client = new ReactNativeClient (
704+ mockedOptions ( {
705+ dsn : EXAMPLE_DSN ,
706+ integrations : [
707+ new ReactNativeTracing ( {
708+ enableUserInteractionTracing : false ,
709+ } ) ,
710+ ] ,
711+ } ) ,
712+ ) ;
713+ client . init ( ) ;
714+
715+ expect ( client . getIntegrationById ( 'ReactNativeUserInteractionTracing' ) ) . toBeUndefined ( ) ;
716+ } ) ;
685717 } ) ;
686718} ) ;
687719
You can’t perform that action at this time.
0 commit comments