Skip to content

Commit c4470a6

Browse files
committed
fix tests
1 parent e585da5 commit c4470a6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

packages/hub/test/scope.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -361,20 +361,20 @@ describe('Scope', () => {
361361
const scope = new Scope();
362362
const span = {
363363
fake: 'span',
364-
getTraceContext: () => ({ a: 'b' }),
364+
toJSON: () => ({ origin: 'manual' }),
365365
} as any;
366366
scope.setSpan(span);
367367
const event: Event = {};
368368
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' });
370370
});
371371

372372
test('existing trace context in event should take precedence', async () => {
373373
expect.assertions(1);
374374
const scope = new Scope();
375375
const span = {
376376
fake: 'span',
377-
getTraceContext: () => ({ a: 'b' }),
377+
toJSON: () => ({ a: 'b' }),
378378
} as any;
379379
scope.setSpan(span);
380380
const event: Event = {
@@ -392,7 +392,7 @@ describe('Scope', () => {
392392
const scope = new Scope();
393393
const transaction = {
394394
fake: 'span',
395-
getTraceContext: () => ({ a: 'b' }),
395+
toJSON: () => ({ a: 'b' }),
396396
name: 'fake transaction',
397397
getDynamicSamplingContext: () => ({}),
398398
} as any;
@@ -410,7 +410,7 @@ describe('Scope', () => {
410410
const transaction = { name: 'fake transaction', getDynamicSamplingContext: () => ({}) };
411411
const span = {
412412
fake: 'span',
413-
getTraceContext: () => ({ a: 'b' }),
413+
toJSON: () => ({ a: 'b' }),
414414
transaction,
415415
} as any;
416416
scope.setSpan(span);

0 commit comments

Comments
 (0)