@@ -361,20 +361,20 @@ describe('Scope', () => {
361
361
const scope = new Scope ( ) ;
362
362
const span = {
363
363
fake : 'span' ,
364
- getTraceContext : ( ) => ( { a : 'b ' } ) ,
364
+ toJSON : ( ) => ( { origin : 'manual ' } ) ,
365
365
} as any ;
366
366
scope . setSpan ( span ) ;
367
367
const event : Event = { } ;
368
368
const processedEvent = await scope . applyToEvent ( event ) ;
369
- expect ( ( processedEvent ! . contexts ! . trace as any ) . a ) . toEqual ( 'b' ) ;
369
+ expect ( processedEvent ! . contexts ! . trace as any ) . toEqual ( { origin : 'manual' } ) ;
370
370
} ) ;
371
371
372
372
test ( 'existing trace context in event should take precedence' , async ( ) => {
373
373
expect . assertions ( 1 ) ;
374
374
const scope = new Scope ( ) ;
375
375
const span = {
376
376
fake : 'span' ,
377
- getTraceContext : ( ) => ( { a : 'b' } ) ,
377
+ toJSON : ( ) => ( { a : 'b' } ) ,
378
378
} as any ;
379
379
scope . setSpan ( span ) ;
380
380
const event : Event = {
@@ -392,7 +392,7 @@ describe('Scope', () => {
392
392
const scope = new Scope ( ) ;
393
393
const transaction = {
394
394
fake : 'span' ,
395
- getTraceContext : ( ) => ( { a : 'b' } ) ,
395
+ toJSON : ( ) => ( { a : 'b' } ) ,
396
396
name : 'fake transaction' ,
397
397
getDynamicSamplingContext : ( ) => ( { } ) ,
398
398
} as any ;
@@ -410,7 +410,7 @@ describe('Scope', () => {
410
410
const transaction = { name : 'fake transaction' , getDynamicSamplingContext : ( ) => ( { } ) } ;
411
411
const span = {
412
412
fake : 'span' ,
413
- getTraceContext : ( ) => ( { a : 'b' } ) ,
413
+ toJSON : ( ) => ( { a : 'b' } ) ,
414
414
transaction,
415
415
} as any ;
416
416
scope . setSpan ( span ) ;
0 commit comments