@@ -996,8 +996,8 @@ describe('BaseClient', () => {
996996 expect ( TestClient . instance ! . event ) . toBeUndefined ( ) ;
997997 // This proves that the reason the event didn't send/didn't get set on the test client is not because there was an
998998 // error, but because `beforeSend` returned `null`
999- expect ( captureExceptionSpy ) . not . toBeCalled ( ) ;
1000- expect ( loggerWarnSpy ) . toBeCalledWith ( 'before send for type `error` returned `null`, will not send event.' ) ;
999+ expect ( captureExceptionSpy ) . not . toHaveBeenCalled ( ) ;
1000+ expect ( loggerWarnSpy ) . toHaveBeenCalledWith ( 'before send for type `error` returned `null`, will not send event.' ) ;
10011001 } ) ;
10021002
10031003 test ( 'calls `beforeSendTransaction` and discards the event' , ( ) => {
@@ -1015,8 +1015,10 @@ describe('BaseClient', () => {
10151015 expect ( TestClient . instance ! . event ) . toBeUndefined ( ) ;
10161016 // This proves that the reason the event didn't send/didn't get set on the test client is not because there was an
10171017 // error, but because `beforeSendTransaction` returned `null`
1018- expect ( captureExceptionSpy ) . not . toBeCalled ( ) ;
1019- expect ( loggerWarnSpy ) . toBeCalledWith ( 'before send for type `transaction` returned `null`, will not send event.' ) ;
1018+ expect ( captureExceptionSpy ) . not . toHaveBeenCalled ( ) ;
1019+ expect ( loggerWarnSpy ) . toHaveBeenCalledWith (
1020+ 'before send for type `transaction` returned `null`, will not send event.' ,
1021+ ) ;
10201022 } ) ;
10211023
10221024 test ( 'calls `beforeSend` and logs info about invalid return value' , ( ) => {
@@ -1034,7 +1036,7 @@ describe('BaseClient', () => {
10341036
10351037 expect ( beforeSend ) . toHaveBeenCalled ( ) ;
10361038 expect ( TestClient . instance ! . event ) . toBeUndefined ( ) ;
1037- expect ( loggerWarnSpy ) . toBeCalledWith (
1039+ expect ( loggerWarnSpy ) . toHaveBeenCalledWith (
10381040 new SentryError ( 'before send for type `error` must return `null` or a valid event.' ) ,
10391041 ) ;
10401042 }
@@ -1055,7 +1057,7 @@ describe('BaseClient', () => {
10551057
10561058 expect ( beforeSendTransaction ) . toHaveBeenCalled ( ) ;
10571059 expect ( TestClient . instance ! . event ) . toBeUndefined ( ) ;
1058- expect ( loggerWarnSpy ) . toBeCalledWith (
1060+ expect ( loggerWarnSpy ) . toHaveBeenCalledWith (
10591061 new SentryError ( 'before send for type `transaction` must return `null` or a valid event.' ) ,
10601062 ) ;
10611063 }
@@ -1317,8 +1319,8 @@ describe('BaseClient', () => {
13171319 expect ( TestClient . instance ! . event ) . toBeUndefined ( ) ;
13181320 // This proves that the reason the event didn't send/didn't get set on the test client is not because there was an
13191321 // error, but because the event processor returned `null`
1320- expect ( captureExceptionSpy ) . not . toBeCalled ( ) ;
1321- expect ( loggerLogSpy ) . toBeCalledWith ( 'An event processor returned `null`, will not send event.' ) ;
1322+ expect ( captureExceptionSpy ) . not . toHaveBeenCalled ( ) ;
1323+ expect ( loggerLogSpy ) . toHaveBeenCalledWith ( 'An event processor returned `null`, will not send event.' ) ;
13221324 } ) ;
13231325
13241326 test ( 'event processor drops transaction event when it returns `null`' , ( ) => {
@@ -1335,8 +1337,8 @@ describe('BaseClient', () => {
13351337 expect ( TestClient . instance ! . event ) . toBeUndefined ( ) ;
13361338 // This proves that the reason the event didn't send/didn't get set on the test client is not because there was an
13371339 // error, but because the event processor returned `null`
1338- expect ( captureExceptionSpy ) . not . toBeCalled ( ) ;
1339- expect ( loggerLogSpy ) . toBeCalledWith ( 'An event processor returned `null`, will not send event.' ) ;
1340+ expect ( captureExceptionSpy ) . not . toHaveBeenCalled ( ) ;
1341+ expect ( loggerLogSpy ) . toHaveBeenCalledWith ( 'An event processor returned `null`, will not send event.' ) ;
13401342 } ) ;
13411343
13421344 test ( 'event processor records dropped error events' , ( ) => {
@@ -1440,13 +1442,13 @@ describe('BaseClient', () => {
14401442 client . captureEvent ( { message : 'hello' } , { } , scope ) ;
14411443
14421444 expect ( TestClient . instance ! . event ! . exception ! . values ! [ 0 ] ) . toStrictEqual ( { type : 'Error' , value : 'sorry' } ) ;
1443- expect ( captureExceptionSpy ) . toBeCalledWith ( exception , {
1445+ expect ( captureExceptionSpy ) . toHaveBeenCalledWith ( exception , {
14441446 data : {
14451447 __sentry__ : true ,
14461448 } ,
14471449 originalException : exception ,
14481450 } ) ;
1449- expect ( loggerWarnSpy ) . toBeCalledWith (
1451+ expect ( loggerWarnSpy ) . toHaveBeenCalledWith (
14501452 new SentryError (
14511453 `Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${ exception } ` ,
14521454 ) ,
@@ -1670,9 +1672,9 @@ describe('BaseClient', () => {
16701672 await undefined ;
16711673 await undefined ;
16721674
1673- expect ( mockSend ) . toBeCalledTimes ( 1 ) ;
1674- expect ( callback ) . toBeCalledTimes ( 1 ) ;
1675- expect ( callback ) . toBeCalledWith ( errorEvent , { } ) ;
1675+ expect ( mockSend ) . toHaveBeenCalledTimes ( 1 ) ;
1676+ expect ( callback ) . toHaveBeenCalledTimes ( 1 ) ;
1677+ expect ( callback ) . toHaveBeenCalledWith ( errorEvent , { } ) ;
16761678 } ) ;
16771679
16781680 it ( 'emits `afterSendEvent` when sending a transaction' , async ( ) => {
@@ -1698,9 +1700,9 @@ describe('BaseClient', () => {
16981700 await undefined ;
16991701 await undefined ;
17001702
1701- expect ( mockSend ) . toBeCalledTimes ( 1 ) ;
1702- expect ( callback ) . toBeCalledTimes ( 1 ) ;
1703- expect ( callback ) . toBeCalledWith ( transactionEvent , { } ) ;
1703+ expect ( mockSend ) . toHaveBeenCalledTimes ( 1 ) ;
1704+ expect ( callback ) . toHaveBeenCalledTimes ( 1 ) ;
1705+ expect ( callback ) . toHaveBeenCalledWith ( transactionEvent , { } ) ;
17041706 } ) ;
17051707
17061708 it ( 'still triggers `afterSendEvent` when transport.send rejects' , async ( ) => {
@@ -1730,9 +1732,9 @@ describe('BaseClient', () => {
17301732 await undefined ;
17311733 await undefined ;
17321734
1733- expect ( mockSend ) . toBeCalledTimes ( 1 ) ;
1734- expect ( callback ) . toBeCalledTimes ( 1 ) ;
1735- expect ( callback ) . toBeCalledWith ( errorEvent , undefined ) ;
1735+ expect ( mockSend ) . toHaveBeenCalledTimes ( 1 ) ;
1736+ expect ( callback ) . toHaveBeenCalledTimes ( 1 ) ;
1737+ expect ( callback ) . toHaveBeenCalledWith ( errorEvent , undefined ) ;
17361738 } ) ;
17371739
17381740 it ( 'passes the response to the hook' , async ( ) => {
@@ -1762,9 +1764,9 @@ describe('BaseClient', () => {
17621764 await undefined ;
17631765 await undefined ;
17641766
1765- expect ( mockSend ) . toBeCalledTimes ( 1 ) ;
1766- expect ( callback ) . toBeCalledTimes ( 1 ) ;
1767- expect ( callback ) . toBeCalledWith ( errorEvent , { statusCode : 200 } ) ;
1767+ expect ( mockSend ) . toHaveBeenCalledTimes ( 1 ) ;
1768+ expect ( callback ) . toHaveBeenCalledTimes ( 1 ) ;
1769+ expect ( callback ) . toHaveBeenCalledWith ( errorEvent , { statusCode : 200 } ) ;
17681770 } ) ;
17691771 } ) ;
17701772
0 commit comments