Skip to content

Commit c5048bd

Browse files
add ttd integration tests
1 parent 3d745b1 commit c5048bd

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

packages/core/src/js/integrations/default.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,9 @@ export function getDefaultIntegrations(options: ReactNativeClientOptions): Integ
116116
integrations.push(appRegistryIntegration());
117117
integrations.push(reactNativeTracingIntegration());
118118
}
119-
integrations.push(timeToDisplayIntegration());
119+
if (hasTracingEnabled) {
120+
integrations.push(timeToDisplayIntegration());
121+
}
120122
if (options.enableCaptureFailedRequests) {
121123
integrations.push(httpClientIntegration());
122124
}

packages/core/test/sdk.test.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -743,6 +743,22 @@ describe('Tests the SDK functionality', () => {
743743
});
744744
});
745745

746+
describe('time to display integration', () => {
747+
it('no integration when tracing disabled', () => {
748+
init({});
749+
750+
expectNotIntegration('TimeToDisplay');
751+
});
752+
753+
it('integration added when tracing enabled', () => {
754+
init({
755+
tracesSampleRate: 0.5,
756+
});
757+
758+
expectIntegration('TimeToDisplay');
759+
});
760+
});
761+
746762
it('adds spotlight integration with spotlight bool', () => {
747763
init({
748764
spotlight: true,

0 commit comments

Comments
 (0)