@@ -208,6 +208,21 @@ const TRANSACTION_EVENT_3: Event = {
208
208
type : 'transaction' ,
209
209
} ;
210
210
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
+
211
226
describe ( 'InboundFilters' , ( ) => {
212
227
describe ( '_isSentryError' , ( ) => {
213
228
it ( 'should work as expected' , ( ) => {
@@ -372,7 +387,28 @@ describe('InboundFilters', () => {
372
387
373
388
it ( 'uses default filters' , ( ) => {
374
389
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 ) ;
375
408
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 ) ;
376
412
} ) ;
377
413
} ) ;
378
414
0 commit comments