@@ -208,6 +208,21 @@ const TRANSACTION_EVENT_3: Event = {
208208 type : 'transaction' ,
209209} ;
210210
211+ const TRANSACTION_EVENT_HEALTH : Event = {
212+ transaction : 'GET /health' ,
213+ type : 'transaction' ,
214+ } ;
215+
216+ const TRANSACTION_EVENT_HEALTH_2 : Event = {
217+ transaction : 'GET /healthy' ,
218+ type : 'transaction' ,
219+ } ;
220+
221+ const TRANSACTION_EVENT_HEALTH_3 : Event = {
222+ transaction : 'GET /live' ,
223+ type : 'transaction' ,
224+ } ;
225+
211226describe ( 'InboundFilters' , ( ) => {
212227 describe ( '_isSentryError' , ( ) => {
213228 it ( 'should work as expected' , ( ) => {
@@ -372,7 +387,28 @@ describe('InboundFilters', () => {
372387
373388 it ( 'uses default filters' , ( ) => {
374389 const eventProcessor = createInboundFiltersEventProcessor ( ) ;
390+ expect ( eventProcessor ( SCRIPT_ERROR_EVENT , { } ) ) . toBe ( null ) ;
391+ expect ( eventProcessor ( TRANSACTION_EVENT , { } ) ) . toBe ( TRANSACTION_EVENT ) ;
392+ expect ( eventProcessor ( TRANSACTION_EVENT_HEALTH , { } ) ) . toBe ( null ) ;
393+ expect ( eventProcessor ( TRANSACTION_EVENT_HEALTH_2 , { } ) ) . toBe ( null ) ;
394+ expect ( eventProcessor ( TRANSACTION_EVENT_HEALTH_3 , { } ) ) . toBe ( null ) ;
395+ } ) ;
396+
397+ it ( 'disable default error filters' , ( ) => {
398+ const eventProcessor = createInboundFiltersEventProcessor ( { disableErrorDefaults : true } ) ;
399+ expect ( eventProcessor ( SCRIPT_ERROR_EVENT , { } ) ) . toBe ( SCRIPT_ERROR_EVENT ) ;
400+ expect ( eventProcessor ( TRANSACTION_EVENT_HEALTH , { } ) ) . toBe ( null ) ;
401+ expect ( eventProcessor ( TRANSACTION_EVENT_HEALTH_2 , { } ) ) . toBe ( null ) ;
402+ expect ( eventProcessor ( TRANSACTION_EVENT_HEALTH_3 , { } ) ) . toBe ( null ) ;
403+ } ) ;
404+
405+ it ( 'disable default transaction filters' , ( ) => {
406+ const eventProcessor = createInboundFiltersEventProcessor ( { disableTransactionDefaults : true } ) ;
407+ expect ( eventProcessor ( SCRIPT_ERROR_EVENT , { } ) ) . toBe ( null ) ;
375408 expect ( eventProcessor ( TRANSACTION_EVENT , { } ) ) . toBe ( TRANSACTION_EVENT ) ;
409+ expect ( eventProcessor ( TRANSACTION_EVENT_HEALTH , { } ) ) . toBe ( TRANSACTION_EVENT_HEALTH ) ;
410+ expect ( eventProcessor ( TRANSACTION_EVENT_HEALTH_2 , { } ) ) . toBe ( TRANSACTION_EVENT_HEALTH_2 ) ;
411+ expect ( eventProcessor ( TRANSACTION_EVENT_HEALTH_3 , { } ) ) . toBe ( TRANSACTION_EVENT_HEALTH_3 ) ;
376412 } ) ;
377413 } ) ;
378414
0 commit comments