File tree Expand file tree Collapse file tree 2 files changed +1
-31
lines changed Expand file tree Collapse file tree 2 files changed +1
-31
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ export class Dispatch {
3838 private dispatchTimerId : number | undefined ;
3939 private buildClient : ClientBuilder ;
4040 private config : Config ;
41- private disableCodes = [ '401' , ' 403', '404' ] ;
41+ private disableCodes = [ '403' , '404' ] ;
4242
4343 constructor (
4444 region : string ,
Original file line number Diff line number Diff line change @@ -479,36 +479,6 @@ describe('Dispatch tests', () => {
479479 expect ( ( dispatch as unknown as any ) . enabled ) . toBe ( true ) ;
480480 } ) ;
481481
482- test ( 'when a fetch request is rejected with 401 then dispatch is disabled' , async ( ) => {
483- // Init
484- ( DataPlaneClient as any ) . mockImplementationOnce ( ( ) => ( {
485- sendFetch : ( ) => Promise . reject ( new Error ( '401' ) )
486- } ) ) ;
487-
488- const eventCache : EventCache =
489- Utils . createDefaultEventCacheWithEvents ( ) ;
490-
491- const dispatch = new Dispatch (
492- Utils . AWS_RUM_REGION ,
493- Utils . AWS_RUM_ENDPOINT ,
494- eventCache ,
495- {
496- ...DEFAULT_CONFIG ,
497- ...{ dispatchInterval : Utils . AUTO_DISPATCH_OFF , retries : 0 }
498- }
499- ) ;
500- dispatch . setAwsCredentials ( Utils . createAwsCredentials ( ) ) ;
501-
502- // Run
503- eventCache . recordEvent ( 'com.amazon.rum.event1' , { } ) ;
504-
505- // Assert
506- await expect ( dispatch . dispatchFetch ( ) ) . rejects . toEqual (
507- new Error ( '401' )
508- ) ;
509- expect ( ( dispatch as unknown as any ) . enabled ) . toBe ( false ) ;
510- } ) ;
511-
512482 test ( 'when a fetch request is rejected with 403 then dispatch is disabled' , async ( ) => {
513483 // Init
514484 ( DataPlaneClient as any ) . mockImplementationOnce ( ( ) => ( {
You can’t perform that action at this time.
0 commit comments