@@ -45,12 +45,8 @@ describe('Flexible Breadcrumbs System', () => {
4545
4646 await new Try ( throwingFunction , params ) . breadcrumbs ( [ ] ) . value ( ) ;
4747
48- expect ( Sentry . addBreadcrumb ) . toHaveBeenCalledWith (
49- expect . objectContaining ( {
50- message : 'Calling throwingFunction function' ,
51- data : { } ,
52- } ) ,
53- ) ;
48+ // Empty extracted data should short-circuit the reporter call.
49+ expect ( Sentry . addBreadcrumb ) . not . toHaveBeenCalled ( ) ;
5450 } ) ;
5551 } ) ;
5652
@@ -332,12 +328,8 @@ describe('Flexible Breadcrumbs System', () => {
332328 'Error in breadcrumb transformer:' ,
333329 expect . any ( Error ) ,
334330 ) ;
335- expect ( Sentry . addBreadcrumb ) . toHaveBeenCalledWith (
336- expect . objectContaining ( {
337- message : 'Calling testFunction function' ,
338- data : { } , // Empty data due to transformer error
339- } ) ,
340- ) ;
331+ // Transformer error yields empty data — reporter call is short-circuited.
332+ expect ( Sentry . addBreadcrumb ) . not . toHaveBeenCalled ( ) ;
341333
342334 consoleSpy . mockRestore ( ) ;
343335 } ) ;
@@ -363,12 +355,8 @@ describe('Flexible Breadcrumbs System', () => {
363355 . value ( ) ;
364356
365357 expect ( consoleSpy ) . not . toHaveBeenCalled ( ) ;
366- expect ( Sentry . addBreadcrumb ) . toHaveBeenCalledWith (
367- expect . objectContaining ( {
368- message : 'Calling testFunction function' ,
369- data : { } , // Empty data due to transformer error
370- } ) ,
371- ) ;
358+ // Transformer error yields empty data — reporter call is short-circuited.
359+ expect ( Sentry . addBreadcrumb ) . not . toHaveBeenCalled ( ) ;
372360
373361 consoleSpy . mockRestore ( ) ;
374362 } ) ;
@@ -409,12 +397,8 @@ describe('Flexible Breadcrumbs System', () => {
409397 . breadcrumbs ( [ { param : 0 , keys : [ 'nonExistentKey' ] } as any ] )
410398 . value ( ) ;
411399
412- expect ( Sentry . addBreadcrumb ) . toHaveBeenCalledWith (
413- expect . objectContaining ( {
414- message : 'Calling testFunction function' ,
415- data : { } , // Empty because param 0 is not an object
416- } ) ,
417- ) ;
400+ // No keys extracted from a primitive — reporter call is short-circuited.
401+ expect ( Sentry . addBreadcrumb ) . not . toHaveBeenCalled ( ) ;
418402 } ) ;
419403 } ) ;
420404
@@ -451,12 +435,8 @@ describe('Flexible Breadcrumbs System', () => {
451435
452436 await new Try ( testFunction , 'test' ) . debug ( false ) . breadcrumbs ( [ ] ) . value ( ) ;
453437
454- expect ( Sentry . addBreadcrumb ) . toHaveBeenCalledWith (
455- expect . objectContaining ( {
456- message : 'Calling testFunction function' ,
457- data : { } ,
458- } ) ,
459- ) ;
438+ // Empty config yields empty data — reporter call is short-circuited.
439+ expect ( Sentry . addBreadcrumb ) . not . toHaveBeenCalled ( ) ;
460440 } ) ;
461441
462442 it ( 'should handle mixed valid and invalid extractors' , async ( ) => {
@@ -544,12 +524,8 @@ describe('Flexible Breadcrumbs System', () => {
544524
545525 await new Try ( noParams ) . debug ( false ) . breadcrumbs ( [ ] ) . value ( ) ;
546526
547- expect ( Sentry . addBreadcrumb ) . toHaveBeenCalledWith (
548- expect . objectContaining ( {
549- message : 'Calling noParams function' ,
550- data : { } ,
551- } ) ,
552- ) ;
527+ // No data extracted — reporter call is short-circuited.
528+ expect ( Sentry . addBreadcrumb ) . not . toHaveBeenCalled ( ) ;
553529 } ) ;
554530
555531 it ( 'should handle anonymous functions properly' , async ( ) => {
0 commit comments