@@ -20,7 +20,7 @@ describe('getDynamicSamplingContextFromSpan', () => {
2020 } ) ;
2121
2222 test ( 'returns the DSC provided during transaction creation' , ( ) => {
23- // eslint-disable-next-line deprecation/deprecation
23+ // eslint-disable-next-line deprecation/deprecation -- using old API on purpose
2424 const transaction = new Transaction ( {
2525 name : 'tx' ,
2626 metadata : { dynamicSamplingContext : { environment : 'myEnv' } } ,
@@ -68,7 +68,7 @@ describe('getDynamicSamplingContextFromSpan', () => {
6868 } ) ;
6969
7070 test ( 'returns a new DSC, if no DSC was provided during transaction creation (via new Txn and deprecated metadata)' , ( ) => {
71- // eslint-disable-next-line deprecation/deprecation
71+ // eslint-disable-next-line deprecation/deprecation -- using old API on purpose
7272 const transaction = new Transaction ( {
7373 name : 'tx' ,
7474 metadata : {
@@ -92,7 +92,7 @@ describe('getDynamicSamplingContextFromSpan', () => {
9292
9393 describe ( 'Including transaction name in DSC' , ( ) => {
9494 test ( 'is not included if transaction source is url' , ( ) => {
95- // eslint-disable-next-line deprecation/deprecation
95+ // eslint-disable-next-line deprecation/deprecation -- using old API on purpose
9696 const transaction = new Transaction ( {
9797 name : 'tx' ,
9898 metadata : {
@@ -109,8 +109,7 @@ describe('getDynamicSamplingContextFromSpan', () => {
109109 [ 'is included if transaction source is parameterized route/url' , 'route' ] ,
110110 [ 'is included if transaction source is a custom name' , 'custom' ] ,
111111 ] ) ( '%s' , ( _ : string , source ) => {
112- // eslint-disable-next-line deprecation/deprecation
113- const transaction = new Transaction ( {
112+ const transaction = startInactiveSpan ( {
114113 name : 'tx' ,
115114 metadata : {
116115 ...( source && { source : source as TransactionSource } ) ,
@@ -120,7 +119,7 @@ describe('getDynamicSamplingContextFromSpan', () => {
120119 // Only setting the attribute manually because we're directly calling new Transaction()
121120 transaction ?. setAttribute ( SEMANTIC_ATTRIBUTE_SENTRY_SOURCE , source ) ;
122121
123- const dsc = getDynamicSamplingContextFromSpan ( transaction ) ;
122+ const dsc = getDynamicSamplingContextFromSpan ( transaction ! ) ;
124123
125124 expect ( dsc . transaction ) . toEqual ( 'tx' ) ;
126125 } ) ;
0 commit comments