@@ -10,16 +10,13 @@ import * as hubExtensions from '@sentry/core';
1010import type { BaseTransportOptions , ClientOptions , DsnComponents , HandlerDataHistory } from '@sentry/types' ;
1111import { JSDOM } from 'jsdom' ;
1212
13- import { BrowserClient } from '@sentry/browser' ;
13+ import { browserTracingIntegration } from '@sentry/browser' ;
1414import { timestampInSeconds } from '@sentry/utils' ;
1515import type { IdleTransaction } from '../../../tracing/src' ;
1616import { getActiveTransaction } from '../../../tracing/src' ;
1717import { getDefaultBrowserClientOptions } from '../../../tracing/test/testutils' ;
18- import { browserTracingIntegration } from '../../build/types' ;
1918import type { BrowserTracingOptions } from '../../src/browser/browsertracing' ;
2019import { getMetaContent } from '../../src/browser/browsertracing' ;
21- import { defaultRequestInstrumentationOptions } from '../../src/browser/request' ;
22- import { instrumentRoutingWithDefaults } from '../../src/browser/router' ;
2320import { WINDOW } from '../../src/browser/types' ;
2421import { TestClient } from '../utils/TestClient' ;
2522
@@ -86,67 +83,12 @@ describe('BrowserTracing', () => {
8683 function createBrowserTracing ( setup ?: boolean , options ?: Partial < BrowserTracingOptions > ) {
8784 const instance = browserTracingIntegration ( options ) ;
8885 if ( setup ) {
89- instance . afterAllSetup ( new BrowserClient ( ) ) ;
86+ instance . afterAllSetup ( new TestClient ( getDefaultBrowserClientOptions ( ) ) ) ;
9087 }
9188
9289 return instance ;
9390 }
9491
95- // These are important enough to check with a test as incorrect defaults could
96- // break a lot of users' configurations.
97- it ( 'is created with default settings' , ( ) => {
98- const browserTracing = createBrowserTracing ( ) ;
99-
100- expect ( browserTracing . options ) . toEqual ( {
101- enableLongTask : true ,
102- _experiments : { } ,
103- ...TRACING_DEFAULTS ,
104- markBackgroundTransactions : true ,
105- routingInstrumentation : instrumentRoutingWithDefaults ,
106- startTransactionOnLocationChange : true ,
107- startTransactionOnPageLoad : true ,
108- ...defaultRequestInstrumentationOptions ,
109- } ) ;
110- } ) ;
111-
112- it ( 'is allows to disable enableLongTask via _experiments' , ( ) => {
113- const browserTracing = createBrowserTracing ( false , {
114- _experiments : {
115- enableLongTask : false ,
116- } ,
117- } ) ;
118-
119- expect ( browserTracing . options ) . toEqual ( {
120- enableLongTask : false ,
121- ...TRACING_DEFAULTS ,
122- markBackgroundTransactions : true ,
123- routingInstrumentation : instrumentRoutingWithDefaults ,
124- startTransactionOnLocationChange : true ,
125- startTransactionOnPageLoad : true ,
126- ...defaultRequestInstrumentationOptions ,
127- _experiments : {
128- enableLongTask : false ,
129- } ,
130- } ) ;
131- } ) ;
132-
133- it ( 'is allows to disable enableLongTask' , ( ) => {
134- const browserTracing = createBrowserTracing ( false , {
135- enableLongTask : false ,
136- } ) ;
137-
138- expect ( browserTracing . options ) . toEqual ( {
139- enableLongTask : false ,
140- _experiments : { } ,
141- ...TRACING_DEFAULTS ,
142- markBackgroundTransactions : true ,
143- routingInstrumentation : instrumentRoutingWithDefaults ,
144- startTransactionOnLocationChange : true ,
145- startTransactionOnPageLoad : true ,
146- ...defaultRequestInstrumentationOptions ,
147- } ) ;
148- } ) ;
149-
15092 /**
15193 * All of these tests under `describe('route transaction')` are tested with
15294 * `browserTracing.options = { routingInstrumentation: customInstrumentRouting }`,
0 commit comments