File tree 2 files changed +38
-0
lines changed
2 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -119,6 +119,10 @@ export class ReactNativeClient extends BaseClient<ReactNativeClientOptions> {
119
119
if ( routingName ) {
120
120
this . addIntegration ( createIntegration ( routingName ) ) ;
121
121
}
122
+ const enableUserInteractionTracing = tracing ?. options . enableUserInteractionTracing ;
123
+ if ( enableUserInteractionTracing ) {
124
+ this . addIntegration ( createIntegration ( 'ReactNativeUserInteractionTracing' ) ) ;
125
+ }
122
126
}
123
127
124
128
/**
Original file line number Diff line number Diff line change @@ -563,6 +563,40 @@ describe('Tests ReactNativeClient', () => {
563
563
expect ( client . getIntegrationById ( 'MockRoutingInstrumentation' ) ) . toBeTruthy ( ) ;
564
564
} ) ;
565
565
} ) ;
566
+
567
+ describe ( 'user interactions tracing as integrations' , ( ) => {
568
+ test ( 'register user interactions tracing' , ( ) => {
569
+ const client = new ReactNativeClient (
570
+ mockedOptions ( {
571
+ dsn : EXAMPLE_DSN ,
572
+ integrations : [
573
+ new ReactNativeTracing ( {
574
+ enableUserInteractionTracing : true ,
575
+ } ) ,
576
+ ] ,
577
+ } ) ,
578
+ ) ;
579
+ client . setupIntegrations ( ) ;
580
+
581
+ expect ( client . getIntegrationById ( 'ReactNativeUserInteractionTracing' ) ) . toBeTruthy ( ) ;
582
+ } ) ;
583
+
584
+ test ( 'do not register user interactions tracing' , ( ) => {
585
+ const client = new ReactNativeClient (
586
+ mockedOptions ( {
587
+ dsn : EXAMPLE_DSN ,
588
+ integrations : [
589
+ new ReactNativeTracing ( {
590
+ enableUserInteractionTracing : false ,
591
+ } ) ,
592
+ ] ,
593
+ } ) ,
594
+ ) ;
595
+ client . setupIntegrations ( ) ;
596
+
597
+ expect ( client . getIntegrationById ( 'ReactNativeUserInteractionTracing' ) ) . toBeUndefined ( ) ;
598
+ } ) ;
599
+ } ) ;
566
600
} ) ;
567
601
568
602
function mockedOptions ( options : Partial < ReactNativeClientOptions > ) : ReactNativeClientOptions {
You can’t perform that action at this time.
0 commit comments