@@ -147,7 +147,7 @@ describe('wrapMethodWithSentry', () => {
147147 expect ( handler ) . toHaveBeenCalled ( ) ;
148148 } ) ;
149149
150- it ( 'does not change sync/async behavior when linkPreviousTrace is true (links are set via waitUntil)' , ( ) => {
150+ it ( 'does not change sync/async behavior when startNewTrace is true (links are set via waitUntil)' , ( ) => {
151151 const handler = vi . fn ( ) . mockReturnValue ( 'sync-result' ) ;
152152 const mockStorage = {
153153 get : vi . fn ( ) . mockResolvedValue ( undefined ) ,
@@ -164,13 +164,12 @@ describe('wrapMethodWithSentry', () => {
164164 context,
165165 spanName : 'alarm' ,
166166 startNewTrace : true ,
167- linkPreviousTrace : true ,
168167 } ;
169168
170169 const wrapped = wrapMethodWithSentry ( options , handler ) ;
171170 const result = wrapped ( ) ;
172171
173- // linkPreviousTrace does not make the result async - links are set via waitUntil
172+ // startNewTrace does not make the result async - links are set via waitUntil
174173 expect ( result ) . not . toBeInstanceOf ( Promise ) ;
175174 expect ( result ) . toBe ( 'sync-result' ) ;
176175
@@ -345,8 +344,8 @@ describe('wrapMethodWithSentry', () => {
345344 } ) ;
346345 } ) ;
347346
348- describe ( 'linkPreviousTrace option ' , ( ) => {
349- it ( 'retrieves stored span context when linkPreviousTrace is true' , async ( ) => {
347+ describe ( 'span linking ' , ( ) => {
348+ it ( 'retrieves stored span context when startNewTrace is true' , async ( ) => {
350349 const storedContext = {
351350 traceId : 'previous-trace-id-1234567890123456' ,
352351 spanId : 'previous-span-id' ,
@@ -365,7 +364,6 @@ describe('wrapMethodWithSentry', () => {
365364 options : { } ,
366365 context,
367366 startNewTrace : true ,
368- linkPreviousTrace : true ,
369367 spanName : 'alarm' ,
370368 } ;
371369
@@ -399,7 +397,6 @@ describe('wrapMethodWithSentry', () => {
399397 options : { } ,
400398 context,
401399 startNewTrace : true ,
402- linkPreviousTrace : true ,
403400 spanName : 'alarm' ,
404401 } ;
405402
@@ -423,7 +420,7 @@ describe('wrapMethodWithSentry', () => {
423420 ) ;
424421 } ) ;
425422
426- it ( 'stores span context after execution when linkPreviousTrace is true' , async ( ) => {
423+ it ( 'stores span context after execution when startNewTrace is true' , async ( ) => {
427424 vi . mocked ( sentryCore . getActiveSpan ) . mockReturnValue ( {
428425 spanContext : vi . fn ( ) . mockReturnValue ( {
429426 traceId : 'current-trace-id-123456789012345678' ,
@@ -445,7 +442,6 @@ describe('wrapMethodWithSentry', () => {
445442 options : { } ,
446443 context,
447444 startNewTrace : true ,
448- linkPreviousTrace : true ,
449445 spanName : 'alarm' ,
450446 } ;
451447
@@ -456,7 +452,7 @@ describe('wrapMethodWithSentry', () => {
456452 expect ( mockStorage . put ) . toHaveBeenCalledWith ( '__SENTRY_TRACE_LINK__alarm' , expect . any ( Object ) ) ;
457453 } ) ;
458454
459- it ( 'does not store span context when linkPreviousTrace is false' , async ( ) => {
455+ it ( 'does not store span context when startNewTrace is false' , async ( ) => {
460456 vi . mocked ( sentryCore . getActiveSpan ) . mockReturnValue ( {
461457 spanContext : vi . fn ( ) . mockReturnValue ( {
462458 traceId : 'current-trace-id-123456789012345678' ,
@@ -479,8 +475,7 @@ describe('wrapMethodWithSentry', () => {
479475 const options = {
480476 options : { } ,
481477 context,
482- startNewTrace : true ,
483- linkPreviousTrace : false ,
478+ startNewTrace : false ,
484479 spanName : 'alarm' ,
485480 } ;
486481
@@ -490,7 +485,7 @@ describe('wrapMethodWithSentry', () => {
490485 // Wait for all waitUntil promises to resolve
491486 await Promise . all ( waitUntilPromises ) ;
492487
493- // Should NOT store span context when linkPreviousTrace is false
488+ // Should NOT store span context when startNewTrace is false
494489 expect ( mockStorage . put ) . not . toHaveBeenCalledWith ( '__SENTRY_TRACE_LINK__alarm' , expect . any ( Object ) ) ;
495490 } ) ;
496491 } ) ;
0 commit comments