Skip to content

Commit 14f2cff

Browse files
committed
fix tracing tests
1 parent c9c1592 commit 14f2cff

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

packages/tracing/test/span.test.ts

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -571,24 +571,19 @@ describe('Span', () => {
571571
hub,
572572
);
573573

574-
const hubSpy = jest.spyOn(hub.getClient()!, 'getOptions');
575-
576574
const dynamicSamplingContext = transaction.getDynamicSamplingContext();
577575

578-
expect(hubSpy).not.toHaveBeenCalled();
579576
expect(dynamicSamplingContext).toStrictEqual({ environment: 'myEnv' });
580577
});
581578

582579
test('should return new DSC, if no DSC was provided during transaction creation', () => {
583-
const transaction = new Transaction(
584-
{
585-
name: 'tx',
586-
metadata: {
587-
sampleRate: 0.56,
588-
},
580+
const transaction = new Transaction({
581+
name: 'tx',
582+
metadata: {
583+
sampleRate: 0.56,
589584
},
590-
hub,
591-
);
585+
sampled: true,
586+
});
592587

593588
const getOptionsSpy = jest.spyOn(hub.getClient()!, 'getOptions');
594589

@@ -598,6 +593,7 @@ describe('Span', () => {
598593
expect(dynamicSamplingContext).toStrictEqual({
599594
release: '1.0.1',
600595
environment: 'production',
596+
sampled: 'true',
601597
sample_rate: '0.56',
602598
trace_id: expect.any(String),
603599
transaction: 'tx',

0 commit comments

Comments
 (0)