@@ -189,7 +189,11 @@ describe('AWSLambda', () => {
189
189
const wrappedHandler = wrapHandler ( handler ) ;
190
190
const rv = await wrappedHandler ( fakeEvent , fakeContext , fakeCallback ) ;
191
191
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
+ } ) ;
193
197
expectScopeSettings ( ) ;
194
198
// @ts -ignore see "Why @ts-ignore" note
195
199
expect ( Sentry . fakeTransaction . finish ) . toBeCalled ( ) ;
@@ -208,7 +212,11 @@ describe('AWSLambda', () => {
208
212
try {
209
213
await wrappedHandler ( fakeEvent , fakeContext , fakeCallback ) ;
210
214
} 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
+ } ) ;
212
220
expectScopeSettings ( ) ;
213
221
expect ( Sentry . captureException ) . toBeCalledWith ( error ) ;
214
222
// @ts -ignore see "Why @ts-ignore" note
@@ -251,6 +259,7 @@ describe('AWSLambda', () => {
251
259
release : '2.12.1' ,
252
260
} ,
253
261
'maisey=silly,charlie=goofy' ,
262
+ true ,
254
263
] ,
255
264
} ,
256
265
} ) ,
@@ -282,6 +291,7 @@ describe('AWSLambda', () => {
282
291
traceId : '12312012123120121231201212312012' ,
283
292
parentSpanId : '1121201211212012' ,
284
293
parentSampled : false ,
294
+ metadata : { baggage : [ { } , '' , true ] } ,
285
295
} ) ;
286
296
expectScopeSettings ( ) ;
287
297
expect ( Sentry . captureException ) . toBeCalledWith ( e ) ;
@@ -302,7 +312,11 @@ describe('AWSLambda', () => {
302
312
const wrappedHandler = wrapHandler ( handler ) ;
303
313
const rv = await wrappedHandler ( fakeEvent , fakeContext , fakeCallback ) ;
304
314
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
+ } ) ;
306
320
expectScopeSettings ( ) ;
307
321
// @ts -ignore see "Why @ts-ignore" note
308
322
expect ( Sentry . fakeTransaction . finish ) . toBeCalled ( ) ;
@@ -332,7 +346,11 @@ describe('AWSLambda', () => {
332
346
try {
333
347
await wrappedHandler ( fakeEvent , fakeContext , fakeCallback ) ;
334
348
} 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
+ } ) ;
336
354
expectScopeSettings ( ) ;
337
355
expect ( Sentry . captureException ) . toBeCalledWith ( error ) ;
338
356
// @ts -ignore see "Why @ts-ignore" note
@@ -367,7 +385,11 @@ describe('AWSLambda', () => {
367
385
const wrappedHandler = wrapHandler ( handler ) ;
368
386
const rv = await wrappedHandler ( fakeEvent , fakeContext , fakeCallback ) ;
369
387
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
+ } ) ;
371
393
expectScopeSettings ( ) ;
372
394
// @ts -ignore see "Why @ts-ignore" note
373
395
expect ( Sentry . fakeTransaction . finish ) . toBeCalled ( ) ;
@@ -397,7 +419,11 @@ describe('AWSLambda', () => {
397
419
try {
398
420
await wrappedHandler ( fakeEvent , fakeContext , fakeCallback ) ;
399
421
} 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
+ } ) ;
401
427
expectScopeSettings ( ) ;
402
428
expect ( Sentry . captureException ) . toBeCalledWith ( error ) ;
403
429
// @ts -ignore see "Why @ts-ignore" note
0 commit comments