@@ -92,17 +92,17 @@ describe('BrowserTracing', () => {
92
92
93
93
/**
94
94
* All of these tests under `describe('route transaction')` are tested with
95
- * `browserTracing.options = { routingInstrumentation: customRoutingInstrumentation }`,
95
+ * `browserTracing.options = { routingInstrumentation: customInstrumentRouting }`,
96
96
* so that we can show this functionality works independent of the default routing integration.
97
97
*/
98
98
describe ( 'route transaction' , ( ) => {
99
- const customRoutingInstrumentation = ( customStartTransaction : ( obj : any ) => void ) => {
99
+ const customInstrumentRouting = ( customStartTransaction : ( obj : any ) => void ) => {
100
100
customStartTransaction ( { name : 'a/path' , op : 'pageload' } ) ;
101
101
} ;
102
102
103
103
it ( 'calls custom routing instrumenation' , ( ) => {
104
104
createBrowserTracing ( true , {
105
- routingInstrumentation : customRoutingInstrumentation ,
105
+ routingInstrumentation : customInstrumentRouting ,
106
106
} ) ;
107
107
108
108
const transaction = getActiveTransaction ( hub ) as IdleTransaction ;
@@ -113,7 +113,7 @@ describe('BrowserTracing', () => {
113
113
114
114
it ( 'trims all transactions' , ( ) => {
115
115
createBrowserTracing ( true , {
116
- routingInstrumentation : customRoutingInstrumentation ,
116
+ routingInstrumentation : customInstrumentRouting ,
117
117
} ) ;
118
118
119
119
const transaction = getActiveTransaction ( hub ) as IdleTransaction ;
@@ -129,7 +129,7 @@ describe('BrowserTracing', () => {
129
129
describe ( 'tracingOrigins' , ( ) => {
130
130
it ( 'warns and uses default tracing origins if none are provided' , ( ) => {
131
131
const inst = createBrowserTracing ( true , {
132
- routingInstrumentation : customRoutingInstrumentation ,
132
+ routingInstrumentation : customInstrumentRouting ,
133
133
} ) ;
134
134
135
135
expect ( warnSpy ) . toHaveBeenCalledTimes ( 2 ) ;
@@ -138,7 +138,7 @@ describe('BrowserTracing', () => {
138
138
139
139
it ( 'warns and uses default tracing origins if empty array given' , ( ) => {
140
140
const inst = createBrowserTracing ( true , {
141
- routingInstrumentation : customRoutingInstrumentation ,
141
+ routingInstrumentation : customInstrumentRouting ,
142
142
tracingOrigins : [ ] ,
143
143
} ) ;
144
144
@@ -148,7 +148,7 @@ describe('BrowserTracing', () => {
148
148
149
149
it ( 'warns and uses default tracing origins if tracing origins are not defined' , ( ) => {
150
150
const inst = createBrowserTracing ( true , {
151
- routingInstrumentation : customRoutingInstrumentation ,
151
+ routingInstrumentation : customInstrumentRouting ,
152
152
tracingOrigins : undefined ,
153
153
} ) ;
154
154
@@ -158,7 +158,7 @@ describe('BrowserTracing', () => {
158
158
159
159
it ( 'sets tracing origins if provided and does not warn' , ( ) => {
160
160
const inst = createBrowserTracing ( true , {
161
- routingInstrumentation : customRoutingInstrumentation ,
161
+ routingInstrumentation : customInstrumentRouting ,
162
162
tracingOrigins : [ 'something' ] ,
163
163
} ) ;
164
164
@@ -172,7 +172,7 @@ describe('BrowserTracing', () => {
172
172
const mockBeforeNavigation = jest . fn ( ) . mockReturnValue ( { name : 'here/is/my/path' } ) ;
173
173
createBrowserTracing ( true , {
174
174
beforeNavigate : mockBeforeNavigation ,
175
- routingInstrumentation : customRoutingInstrumentation ,
175
+ routingInstrumentation : customInstrumentRouting ,
176
176
} ) ;
177
177
const transaction = getActiveTransaction ( hub ) as IdleTransaction ;
178
178
expect ( transaction ) . toBeDefined ( ) ;
@@ -184,7 +184,7 @@ describe('BrowserTracing', () => {
184
184
const mockBeforeNavigation = jest . fn ( ) . mockReturnValue ( undefined ) ;
185
185
createBrowserTracing ( true , {
186
186
beforeNavigate : mockBeforeNavigation ,
187
- routingInstrumentation : customRoutingInstrumentation ,
187
+ routingInstrumentation : customInstrumentRouting ,
188
188
} ) ;
189
189
const transaction = getActiveTransaction ( hub ) as IdleTransaction ;
190
190
expect ( transaction . sampled ) . toBe ( false ) ;
@@ -199,7 +199,7 @@ describe('BrowserTracing', () => {
199
199
} ) ) ;
200
200
createBrowserTracing ( true , {
201
201
beforeNavigate : mockBeforeNavigation ,
202
- routingInstrumentation : customRoutingInstrumentation ,
202
+ routingInstrumentation : customInstrumentRouting ,
203
203
} ) ;
204
204
const transaction = getActiveTransaction ( hub ) as IdleTransaction ;
205
205
expect ( transaction ) . toBeDefined ( ) ;
@@ -215,7 +215,7 @@ describe('BrowserTracing', () => {
215
215
document . head . innerHTML = `<meta name="${ name } " content="${ content } ">` ;
216
216
const startIdleTransaction = jest . spyOn ( hubExtensions , 'startIdleTransaction' ) ;
217
217
218
- createBrowserTracing ( true , { routingInstrumentation : customRoutingInstrumentation } ) ;
218
+ createBrowserTracing ( true , { routingInstrumentation : customInstrumentRouting } ) ;
219
219
220
220
expect ( startIdleTransaction ) . toHaveBeenCalledWith (
221
221
expect . any ( Object ) ,
@@ -232,7 +232,7 @@ describe('BrowserTracing', () => {
232
232
233
233
describe ( 'idleTimeout' , ( ) => {
234
234
it ( 'is created by default' , ( ) => {
235
- createBrowserTracing ( true , { routingInstrumentation : customRoutingInstrumentation } ) ;
235
+ createBrowserTracing ( true , { routingInstrumentation : customInstrumentRouting } ) ;
236
236
const mockFinish = jest . fn ( ) ;
237
237
const transaction = getActiveTransaction ( hub ) as IdleTransaction ;
238
238
transaction . finish = mockFinish ;
@@ -246,7 +246,7 @@ describe('BrowserTracing', () => {
246
246
} ) ;
247
247
248
248
it ( 'can be a custom value' , ( ) => {
249
- createBrowserTracing ( true , { idleTimeout : 2000 , routingInstrumentation : customRoutingInstrumentation } ) ;
249
+ createBrowserTracing ( true , { idleTimeout : 2000 , routingInstrumentation : customInstrumentRouting } ) ;
250
250
const mockFinish = jest . fn ( ) ;
251
251
const transaction = getActiveTransaction ( hub ) as IdleTransaction ;
252
252
transaction . finish = mockFinish ;
@@ -262,7 +262,7 @@ describe('BrowserTracing', () => {
262
262
263
263
describe ( 'maxTransactionDuration' , ( ) => {
264
264
it ( 'cancels a transaction if exceeded' , ( ) => {
265
- createBrowserTracing ( true , { routingInstrumentation : customRoutingInstrumentation } ) ;
265
+ createBrowserTracing ( true , { routingInstrumentation : customInstrumentRouting } ) ;
266
266
const transaction = getActiveTransaction ( hub ) as IdleTransaction ;
267
267
transaction . finish ( transaction . startTimestamp + secToMs ( DEFAULT_MAX_TRANSACTION_DURATION_SECONDS ) + 1 ) ;
268
268
@@ -271,7 +271,7 @@ describe('BrowserTracing', () => {
271
271
} ) ;
272
272
273
273
it ( 'does not cancel a transaction if not exceeded' , ( ) => {
274
- createBrowserTracing ( true , { routingInstrumentation : customRoutingInstrumentation } ) ;
274
+ createBrowserTracing ( true , { routingInstrumentation : customInstrumentRouting } ) ;
275
275
const transaction = getActiveTransaction ( hub ) as IdleTransaction ;
276
276
transaction . finish ( transaction . startTimestamp + secToMs ( DEFAULT_MAX_TRANSACTION_DURATION_SECONDS ) ) ;
277
277
@@ -285,7 +285,7 @@ describe('BrowserTracing', () => {
285
285
expect ( DEFAULT_MAX_TRANSACTION_DURATION_SECONDS < customMaxTransactionDuration ) . toBe ( true ) ;
286
286
createBrowserTracing ( true , {
287
287
maxTransactionDuration : customMaxTransactionDuration ,
288
- routingInstrumentation : customRoutingInstrumentation ,
288
+ routingInstrumentation : customInstrumentRouting ,
289
289
} ) ;
290
290
const transaction = getActiveTransaction ( hub ) as IdleTransaction ;
291
291
0 commit comments