@@ -5,15 +5,23 @@ import { getTracingMetaTags, isValidBaggageString } from '../../src/server/meta'
55
66const mockedSpan = {
77 isRecording : ( ) => true ,
8- traceId : '12345678901234567890123456789012' ,
9- spanId : '1234567890123456' ,
8+ spanContext : ( ) => {
9+ return {
10+ traceId : '12345678901234567890123456789012' ,
11+ spanId : '1234567890123456' ,
12+ traceFlags : TraceFlagSampled ,
13+ } ;
14+ } ,
1015 transaction : {
1116 getDynamicSamplingContext : ( ) => ( {
1217 environment : 'production' ,
1318 } ) ,
1419 } ,
1520} as any ;
1621
22+ // eslint-disable-next-line no-bitwise
23+ const TraceFlagSampled = 0x1 << 0 ;
24+
1725const mockedClient = { } as any ;
1826
1927const mockedScope = {
@@ -71,8 +79,13 @@ describe('getTracingMetaTags', () => {
7179 // @ts -expect-error - only passing a partial span object
7280 {
7381 isRecording : ( ) => true ,
74- traceId : '12345678901234567890123456789012' ,
75- spanId : '1234567890123456' ,
82+ spanContext : ( ) => {
83+ return {
84+ traceId : '12345678901234567890123456789012' ,
85+ spanId : '1234567890123456' ,
86+ traceFlags : TraceFlagSampled ,
87+ } ;
88+ } ,
7689 transaction : undefined ,
7790 } ,
7891 mockedScope ,
@@ -84,7 +97,7 @@ describe('getTracingMetaTags', () => {
8497 } ) ;
8598 } ) ;
8699
87- it ( 'returns only the `sentry-trace` tag if no DSC is available' , ( ) => {
100+ it ( 'returns only the `sentry-trace` tag if no DSC is available without a client ' , ( ) => {
88101 vi . spyOn ( SentryCore , 'getDynamicSamplingContextFromClient' ) . mockReturnValueOnce ( {
89102 trace_id : '' ,
90103 public_key : undefined ,
@@ -94,8 +107,13 @@ describe('getTracingMetaTags', () => {
94107 // @ts -expect-error - only passing a partial span object
95108 {
96109 isRecording : ( ) => true ,
97- traceId : '12345678901234567890123456789012' ,
98- spanId : '1234567890123456' ,
110+ spanContext : ( ) => {
111+ return {
112+ traceId : '12345678901234567890123456789012' ,
113+ spanId : '1234567890123456' ,
114+ traceFlags : TraceFlagSampled ,
115+ } ;
116+ } ,
99117 transaction : undefined ,
100118 } ,
101119 mockedScope ,
0 commit comments