@@ -189,7 +189,11 @@ describe('AWSLambda', () => {
189189 const wrappedHandler = wrapHandler ( handler ) ;
190190 const rv = await wrappedHandler ( fakeEvent , fakeContext , fakeCallback ) ;
191191 expect ( rv ) . toStrictEqual ( 42 ) ;
192- expect ( Sentry . startTransaction ) . toBeCalledWith ( { name : 'functionName' , op : 'awslambda.handler' } ) ;
192+ expect ( Sentry . startTransaction ) . toBeCalledWith ( {
193+ name : 'functionName' ,
194+ op : 'awslambda.handler' ,
195+ metadata : { baggage : [ { } , '' , false ] } ,
196+ } ) ;
193197 expectScopeSettings ( ) ;
194198 // @ts -ignore see "Why @ts-ignore" note
195199 expect ( Sentry . fakeTransaction . finish ) . toBeCalled ( ) ;
@@ -208,7 +212,11 @@ describe('AWSLambda', () => {
208212 try {
209213 await wrappedHandler ( fakeEvent , fakeContext , fakeCallback ) ;
210214 } catch ( e ) {
211- expect ( Sentry . startTransaction ) . toBeCalledWith ( { name : 'functionName' , op : 'awslambda.handler' } ) ;
215+ expect ( Sentry . startTransaction ) . toBeCalledWith ( {
216+ name : 'functionName' ,
217+ op : 'awslambda.handler' ,
218+ metadata : { baggage : [ { } , '' , false ] } ,
219+ } ) ;
212220 expectScopeSettings ( ) ;
213221 expect ( Sentry . captureException ) . toBeCalledWith ( error ) ;
214222 // @ts -ignore see "Why @ts-ignore" note
@@ -251,6 +259,7 @@ describe('AWSLambda', () => {
251259 release : '2.12.1' ,
252260 } ,
253261 'maisey=silly,charlie=goofy' ,
262+ true ,
254263 ] ,
255264 } ,
256265 } ) ,
@@ -282,6 +291,7 @@ describe('AWSLambda', () => {
282291 traceId : '12312012123120121231201212312012' ,
283292 parentSpanId : '1121201211212012' ,
284293 parentSampled : false ,
294+ metadata : { baggage : [ { } , '' , true ] } ,
285295 } ) ;
286296 expectScopeSettings ( ) ;
287297 expect ( Sentry . captureException ) . toBeCalledWith ( e ) ;
@@ -302,7 +312,11 @@ describe('AWSLambda', () => {
302312 const wrappedHandler = wrapHandler ( handler ) ;
303313 const rv = await wrappedHandler ( fakeEvent , fakeContext , fakeCallback ) ;
304314 expect ( rv ) . toStrictEqual ( 42 ) ;
305- expect ( Sentry . startTransaction ) . toBeCalledWith ( { name : 'functionName' , op : 'awslambda.handler' } ) ;
315+ expect ( Sentry . startTransaction ) . toBeCalledWith ( {
316+ name : 'functionName' ,
317+ op : 'awslambda.handler' ,
318+ metadata : { baggage : [ { } , '' , false ] } ,
319+ } ) ;
306320 expectScopeSettings ( ) ;
307321 // @ts -ignore see "Why @ts-ignore" note
308322 expect ( Sentry . fakeTransaction . finish ) . toBeCalled ( ) ;
@@ -332,7 +346,11 @@ describe('AWSLambda', () => {
332346 try {
333347 await wrappedHandler ( fakeEvent , fakeContext , fakeCallback ) ;
334348 } catch ( e ) {
335- expect ( Sentry . startTransaction ) . toBeCalledWith ( { name : 'functionName' , op : 'awslambda.handler' } ) ;
349+ expect ( Sentry . startTransaction ) . toBeCalledWith ( {
350+ name : 'functionName' ,
351+ op : 'awslambda.handler' ,
352+ metadata : { baggage : [ { } , '' , false ] } ,
353+ } ) ;
336354 expectScopeSettings ( ) ;
337355 expect ( Sentry . captureException ) . toBeCalledWith ( error ) ;
338356 // @ts -ignore see "Why @ts-ignore" note
@@ -367,7 +385,11 @@ describe('AWSLambda', () => {
367385 const wrappedHandler = wrapHandler ( handler ) ;
368386 const rv = await wrappedHandler ( fakeEvent , fakeContext , fakeCallback ) ;
369387 expect ( rv ) . toStrictEqual ( 42 ) ;
370- expect ( Sentry . startTransaction ) . toBeCalledWith ( { name : 'functionName' , op : 'awslambda.handler' } ) ;
388+ expect ( Sentry . startTransaction ) . toBeCalledWith ( {
389+ name : 'functionName' ,
390+ op : 'awslambda.handler' ,
391+ metadata : { baggage : [ { } , '' , false ] } ,
392+ } ) ;
371393 expectScopeSettings ( ) ;
372394 // @ts -ignore see "Why @ts-ignore" note
373395 expect ( Sentry . fakeTransaction . finish ) . toBeCalled ( ) ;
@@ -397,7 +419,11 @@ describe('AWSLambda', () => {
397419 try {
398420 await wrappedHandler ( fakeEvent , fakeContext , fakeCallback ) ;
399421 } catch ( e ) {
400- expect ( Sentry . startTransaction ) . toBeCalledWith ( { name : 'functionName' , op : 'awslambda.handler' } ) ;
422+ expect ( Sentry . startTransaction ) . toBeCalledWith ( {
423+ name : 'functionName' ,
424+ op : 'awslambda.handler' ,
425+ metadata : { baggage : [ { } , '' , false ] } ,
426+ } ) ;
401427 expectScopeSettings ( ) ;
402428 expect ( Sentry . captureException ) . toBeCalledWith ( error ) ;
403429 // @ts -ignore see "Why @ts-ignore" note
0 commit comments