@@ -25,6 +25,7 @@ jest.mock('@sentry/utils', () => {
25
25
...actual ,
26
26
addInstrumentationHandler : ( { callback, type } : any ) : void => {
27
27
if ( type === 'history' ) {
28
+ // rather than actually add the navigation-change handler, grab a reference to it, so we can trigger it manually
28
29
mockChangeHistory = callback ;
29
30
}
30
31
} ,
@@ -64,17 +65,17 @@ describe('BrowserTracing', () => {
64
65
} ) ;
65
66
66
67
function createBrowserTracing ( setup ?: boolean , _options ?: Partial < BrowserTracingOptions > ) : BrowserTracing {
67
- const inst = new BrowserTracing ( _options ) ;
68
+ const instance = new BrowserTracing ( _options ) ;
68
69
if ( setup ) {
69
70
const processor = ( ) => undefined ;
70
- inst . setupOnce ( processor , ( ) => hub ) ;
71
+ instance . setupOnce ( processor , ( ) => hub ) ;
71
72
}
72
73
73
- return inst ;
74
+ return instance ;
74
75
}
75
76
76
77
// These are important enough to check with a test as incorrect defaults could
77
- // break a lot of users configurations.
78
+ // break a lot of users' configurations.
78
79
it ( 'is created with default settings' , ( ) => {
79
80
const browserTracing = createBrowserTracing ( ) ;
80
81
@@ -126,7 +127,7 @@ describe('BrowserTracing', () => {
126
127
} ) ;
127
128
128
129
describe ( 'tracingOrigins' , ( ) => {
129
- it ( 'warns and uses default tracing origins if non are provided' , ( ) => {
130
+ it ( 'warns and uses default tracing origins if none are provided' , ( ) => {
130
131
const inst = createBrowserTracing ( true , {
131
132
routingInstrumentation : customRoutingInstrumentation ,
132
133
} ) ;
0 commit comments