1
1
import { BrowserClient } from '@sentry/browser' ;
2
2
import { setupBrowserTransport } from '@sentry/browser/src/transports' ;
3
+ import { getDefaultBrowserClientOptions } from '@sentry/browser/test/unit/helper/browser-client-options' ;
3
4
import { Hub , makeMain } from '@sentry/hub' ;
4
5
import { getGlobalObject , InstrumentHandlerCallback , InstrumentHandlerType } from '@sentry/utils' ;
5
6
import { JSDOM } from 'jsdom' ;
@@ -52,7 +53,7 @@ describe('BrowserTracing', () => {
52
53
let hub : Hub ;
53
54
beforeEach ( ( ) => {
54
55
jest . useFakeTimers ( ) ;
55
- const options = { tracesSampleRate : 1 } ;
56
+ const options = getDefaultBrowserClientOptions ( { tracesSampleRate : 1 } ) ;
56
57
hub = new Hub ( new BrowserClient ( options , setupBrowserTransport ( options ) . transport ) ) ;
57
58
makeMain ( hub ) ;
58
59
document . head . innerHTML = '' ;
@@ -474,7 +475,7 @@ describe('BrowserTracing', () => {
474
475
getGlobalObject < Window > ( ) . location = dogParkLocation as any ;
475
476
476
477
const tracesSampler = jest . fn ( ) ;
477
- const options = { tracesSampler } ;
478
+ const options = getDefaultBrowserClientOptions ( { tracesSampler } ) ;
478
479
hub . bindClient ( new BrowserClient ( options , setupBrowserTransport ( options ) . transport ) ) ;
479
480
// setting up the BrowserTracing integration automatically starts a pageload transaction
480
481
createBrowserTracing ( true ) ;
@@ -491,7 +492,7 @@ describe('BrowserTracing', () => {
491
492
getGlobalObject < Window > ( ) . location = dogParkLocation as any ;
492
493
493
494
const tracesSampler = jest . fn ( ) ;
494
- const options = { tracesSampler } ;
495
+ const options = getDefaultBrowserClientOptions ( { tracesSampler } ) ;
495
496
hub . bindClient ( new BrowserClient ( options , setupBrowserTransport ( options ) . transport ) ) ;
496
497
// setting up the BrowserTracing integration normally automatically starts a pageload transaction, but that's not
497
498
// what we're testing here
0 commit comments