@@ -599,77 +599,4 @@ describe('interceptors', function () {
599599
600600 expect ( instance . interceptors . response . handlers . length ) . toBe ( 0 ) ;
601601 } ) ;
602-
603- it ( 'should handler the error in the same request interceptors' , function ( done ) {
604- const rejectedSpy1 = jasmine . createSpy ( 'rejectedSpy1' ) ;
605- const rejectedSpy2 = jasmine . createSpy ( 'rejectedSpy2' ) ;
606- const error1 = new Error ( 'deadly error 1' ) ;
607- const error2 = new Error ( 'deadly error 2' ) ;
608- axios . interceptors . request . use ( function ( ) {
609- throw error1 ;
610- } , rejectedSpy1 ) ;
611-
612- axios . interceptors . request . use ( function ( ) {
613- throw error2 ;
614- } , rejectedSpy2 ) ;
615-
616- axios ( '/foo' ) . catch ( ) ;
617-
618- getAjaxRequest ( ) . then ( function ( ) {
619- expect ( rejectedSpy1 ) . toHaveBeenCalledWith ( error1 ) ;
620- expect ( rejectedSpy2 ) . toHaveBeenCalledWith ( error2 ) ;
621- done ( ) ;
622- } ) ;
623- } ) ;
624-
625- it ( 'should handle the error in the same response interceptors' , function ( done ) {
626- const rejectedSpy1 = jasmine . createSpy ( 'rejectedSpy1' ) ;
627- const rejectedSpy2 = jasmine . createSpy ( 'rejectedSpy2' ) ;
628- const error1 = new Error ( 'deadly error 1' ) ;
629- const error2 = new Error ( 'deadly error 2' ) ;
630- axios . interceptors . response . use ( function ( ) {
631- throw error1 ;
632- } , rejectedSpy1 ) ;
633-
634- axios . interceptors . response . use ( function ( ) {
635- throw error2 ;
636- } , rejectedSpy2 ) ;
637-
638- axios ( '/foo' ) ;
639-
640- getAjaxRequest ( ) . then ( function ( request ) {
641- request . respondWith ( {
642- status : 200 ,
643- responseText : 'OK'
644- } ) ;
645-
646- setTimeout ( function ( ) {
647- expect ( rejectedSpy1 ) . toHaveBeenCalledWith ( error1 ) ;
648- expect ( rejectedSpy2 ) . toHaveBeenCalledWith ( error2 ) ;
649- done ( ) ;
650- } , 100 ) ;
651- } ) ;
652- } ) ;
653-
654- it ( 'should skip the modification of config in the interceptors throwing error' , function ( done ) {
655- const rejectedSpy = jasmine . createSpy ( 'rejectedSpy' ) ;
656- const error = new Error ( 'deadly error' ) ;
657-
658- axios . interceptors . request . use ( function ( config ) {
659- config . headers . test = 'added by interceptor' ;
660- return config ;
661- } ) ;
662-
663- axios . interceptors . request . use ( function ( ) {
664- throw error ;
665- } , rejectedSpy ) ;
666-
667- axios ( '/foo' ) . catch ( ) ;
668-
669- getAjaxRequest ( ) . then ( function ( request ) {
670- expect ( rejectedSpy ) . toHaveBeenCalledWith ( error ) ;
671- expect ( request . requestHeaders . test ) . toBe ( 'added by interceptor' ) ;
672- done ( ) ;
673- } ) ;
674- } ) ;
675602} ) ;
0 commit comments