File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
packages/tracing-internal/test/browser Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -308,18 +308,20 @@ describe('BrowserTracing', () => {
308
308
expect ( mockBeforeNavigation ) . toHaveBeenCalledTimes ( 1 ) ;
309
309
} ) ;
310
310
311
- it ( 'sets transaction name source to default `custom ` if name is not changed' , ( ) => {
311
+ it ( 'sets transaction name source to default `url ` if name is not changed' , ( ) => {
312
312
const mockBeforeNavigation = jest . fn ( ctx => ( {
313
313
...ctx ,
314
314
} ) ) ;
315
315
createBrowserTracing ( true , {
316
316
beforeNavigate : mockBeforeNavigation ,
317
- routingInstrumentation : customInstrumentRouting ,
317
+ routingInstrumentation : ( customStartTransaction : ( obj : any ) => void ) => {
318
+ customStartTransaction ( { name : 'a/path' , op : 'pageload' , metadata : { source : 'url' } } ) ;
319
+ } ,
318
320
} ) ;
319
321
const transaction = getActiveTransaction ( hub ) as IdleTransaction ;
320
322
expect ( transaction ) . toBeDefined ( ) ;
321
323
expect ( transaction . name ) . toBe ( 'a/path' ) ;
322
- expect ( transaction . metadata . source ) . toBe ( 'custom ' ) ;
324
+ expect ( transaction . metadata . source ) . toBe ( 'url ' ) ;
323
325
324
326
expect ( mockBeforeNavigation ) . toHaveBeenCalledTimes ( 1 ) ;
325
327
} ) ;
You can’t perform that action at this time.
0 commit comments