@@ -940,13 +940,13 @@ describe('BaseClient', () => {
940
940
const options = getDefaultTestClientOptions ( { dsn : PUBLIC_DSN , beforeSend } ) ;
941
941
const client = new TestClient ( options ) ;
942
942
const captureExceptionSpy = jest . spyOn ( client , 'captureException' ) ;
943
- const loggerErrorSpy = jest . spyOn ( logger , 'error ' ) ;
943
+ const loggerWarnSpy = jest . spyOn ( logger , 'warn ' ) ;
944
944
945
945
client . captureEvent ( { message : 'hello' } ) ;
946
946
947
947
expect ( TestClient . instance ! . event ) . toBeUndefined ( ) ;
948
948
expect ( captureExceptionSpy ) . not . toBeCalled ( ) ;
949
- expect ( loggerErrorSpy ) . toBeCalledWith ( new SentryError ( '`beforeSend` returned `null`, will not send event.' ) ) ;
949
+ expect ( loggerWarnSpy ) . toBeCalledWith ( new SentryError ( '`beforeSend` returned `null`, will not send event.' ) ) ;
950
950
} ) ;
951
951
952
952
test ( 'calls beforeSend and log info about invalid return value' , ( ) => {
@@ -958,12 +958,12 @@ describe('BaseClient', () => {
958
958
// @ts -ignore we need to test regular-js behavior
959
959
const options = getDefaultTestClientOptions ( { dsn : PUBLIC_DSN , beforeSend } ) ;
960
960
const client = new TestClient ( options ) ;
961
- const loggerErrorSpy = jest . spyOn ( logger , 'error ' ) ;
961
+ const loggerWarnSpy = jest . spyOn ( logger , 'warn ' ) ;
962
962
963
963
client . captureEvent ( { message : 'hello' } ) ;
964
964
965
965
expect ( TestClient . instance ! . event ) . toBeUndefined ( ) ;
966
- expect ( loggerErrorSpy ) . toBeCalledWith (
966
+ expect ( loggerWarnSpy ) . toBeCalledWith (
967
967
new SentryError ( '`beforeSend` method has to return `null` or a valid event.' ) ,
968
968
) ;
969
969
}
@@ -1091,15 +1091,15 @@ describe('BaseClient', () => {
1091
1091
1092
1092
const client = new TestClient ( getDefaultTestClientOptions ( { dsn : PUBLIC_DSN } ) ) ;
1093
1093
const captureExceptionSpy = jest . spyOn ( client , 'captureException' ) ;
1094
- const loggerErrorSpy = jest . spyOn ( logger , 'error ' ) ;
1094
+ const loggerWarnSpy = jest . spyOn ( logger , 'warn ' ) ;
1095
1095
const scope = new Scope ( ) ;
1096
1096
scope . addEventProcessor ( ( ) => null ) ;
1097
1097
1098
1098
client . captureEvent ( { message : 'hello' } , { } , scope ) ;
1099
1099
1100
1100
expect ( TestClient . instance ! . event ) . toBeUndefined ( ) ;
1101
1101
expect ( captureExceptionSpy ) . not . toBeCalled ( ) ;
1102
- expect ( loggerErrorSpy ) . toBeCalledWith ( new SentryError ( 'An event processor returned null, will not send event.' ) ) ;
1102
+ expect ( loggerWarnSpy ) . toBeCalledWith ( new SentryError ( 'An event processor returned null, will not send event.' ) ) ;
1103
1103
} ) ;
1104
1104
1105
1105
// TODO(v7): Add back tests with client reports
@@ -1131,7 +1131,7 @@ describe('BaseClient', () => {
1131
1131
const options = getDefaultTestClientOptions ( { dsn : PUBLIC_DSN } ) ;
1132
1132
const client = new TestClient ( options ) ;
1133
1133
const captureExceptionSpy = jest . spyOn ( client , 'captureException' ) ;
1134
- const loggerErrorSpy = jest . spyOn ( logger , 'error ' ) ;
1134
+ const loggerWarnSpy = jest . spyOn ( logger , 'warn ' ) ;
1135
1135
const scope = new Scope ( ) ;
1136
1136
const exception = new Error ( 'sorry' ) ;
1137
1137
scope . addEventProcessor ( ( ) => {
@@ -1147,7 +1147,7 @@ describe('BaseClient', () => {
1147
1147
} ,
1148
1148
originalException : exception ,
1149
1149
} ) ;
1150
- expect ( loggerErrorSpy ) . toBeCalledWith (
1150
+ expect ( loggerWarnSpy ) . toBeCalledWith (
1151
1151
new SentryError (
1152
1152
`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${ exception } ` ,
1153
1153
) ,
0 commit comments