@@ -9,9 +9,8 @@ describe('span links', () => {
99 transaction : event => {
1010 expect ( event . transaction ) . toBe ( 'span1' ) ;
1111
12- // assigning a string to prevent "might be undefined"
13- span1_traceId = event . contexts ?. trace ?. trace_id || 'non-existent-trace-id' ;
14- span1_spanId = event . contexts ?. trace ?. span_id || 'non-existent-span-id' ;
12+ span1_traceId = event . contexts ?. trace ?. trace_id as string ;
13+ span1_spanId = event . contexts ?. trace ?. span_id as string ;
1514
1615 expect ( event . spans ) . toEqual ( [ ] ) ;
1716 } ,
@@ -42,9 +41,8 @@ describe('span links', () => {
4241 transaction : event => {
4342 expect ( event . transaction ) . toBe ( 'span1' ) ;
4443
45- // assigning a string to prevent "might be undefined"
46- span1_traceId = event . contexts ?. trace ?. trace_id || 'non-existent-trace-id' ;
47- span1_spanId = event . contexts ?. trace ?. span_id || 'non-existent-span-id' ;
44+ span1_traceId = event . contexts ?. trace ?. trace_id as string ;
45+ span1_spanId = event . contexts ?. trace ?. span_id as string ;
4846
4947 expect ( event . spans ) . toEqual ( [ ] ) ;
5048 } ,
@@ -53,9 +51,8 @@ describe('span links', () => {
5351 transaction : event => {
5452 expect ( event . transaction ) . toBe ( 'span2' ) ;
5553
56- // assigning a string to prevent "might be undefined"
57- span2_traceId = event . contexts ?. trace ?. trace_id || 'non-existent-trace-id' ;
58- span2_spanId = event . contexts ?. trace ?. span_id || 'non-existent-span-id' ;
54+ span2_traceId = event . contexts ?. trace ?. trace_id as string ;
55+ span2_spanId = event . contexts ?. trace ?. span_id as string ;
5956
6057 expect ( event . spans ) . toEqual ( [ ] ) ;
6158 } ,
@@ -89,9 +86,8 @@ describe('span links', () => {
8986 transaction : event => {
9087 expect ( event . transaction ) . toBe ( 'parent1' ) ;
9188
92- // assigning a string to prevent "might be undefined"
93- const parent1_traceId = event . contexts ?. trace ?. trace_id || 'non-existent-span-id' ;
94- const parent1_spanId = event . contexts ?. trace ?. span_id || 'non-existent-span-id' ;
89+ const parent1_traceId = event . contexts ?. trace ?. trace_id as string ;
90+ const parent1_spanId = event . contexts ?. trace ?. span_id as string ;
9591
9692 const spans = event . spans || [ ] ;
9793 const child1_1 = spans . find ( span => span . description === 'child1.1' ) ;
@@ -129,9 +125,8 @@ describe('span links', () => {
129125 transaction : event => {
130126 expect ( event . transaction ) . toBe ( 'parent1' ) ;
131127
132- // assigning a string to prevent "might be undefined"
133- const parent1_traceId = event . contexts ?. trace ?. trace_id || 'non-existent-span-id' ;
134- const parent1_spanId = event . contexts ?. trace ?. span_id || 'non-existent-span-id' ;
128+ const parent1_traceId = event . contexts ?. trace ?. trace_id as string ;
129+ const parent1_spanId = event . contexts ?. trace ?. span_id as string ;
135130
136131 const spans = event . spans || [ ] ;
137132 const child1_1 = spans . find ( span => span . description === 'child1.1' ) ;
0 commit comments