This repository was archived by the owner on Feb 13, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2222 "circle-lint" : " .buildscript/circle.sh" ,
2323 "dependencies" : " yarn" ,
2424 "size" : " size-limit" ,
25- "test" : " standard && nyc ava && .buildscript/e2e.sh" ,
25+ "test" : " standard && nyc ava --timeout=20s && .buildscript/e2e.sh" ,
2626 "report-coverage" : " nyc report --reporter=lcov > coverage.lcov && codecov" ,
2727 "np" : " np --no-publish" ,
2828 "release" : " yarn run np"
Original file line number Diff line number Diff line change @@ -72,6 +72,12 @@ test.before.cb(t => {
7272 } )
7373 }
7474
75+ if ( batch [ 0 ] === 'axios-retry-forever' ) {
76+ return res . status ( 503 ) . json ( {
77+ error : { message : 'Service Unavailable' }
78+ } )
79+ }
80+
7581 res . json ( { } )
7682 } )
7783 . listen ( port , t . end )
@@ -586,6 +592,20 @@ test('ensure that failed requests are retried', async t => {
586592 await t . notThrows ( client . flush ( ) )
587593} )
588594
595+ test ( 'ensure that failed requests are not retried forever' , async t => {
596+ const client = createClient ( )
597+ const callback = spy ( )
598+
599+ client . queue = [
600+ {
601+ message : 'axios-retry-forever' ,
602+ callback
603+ }
604+ ]
605+
606+ await t . throws ( client . flush ( ) )
607+ } )
608+
589609test ( 'ensure other axios clients are not impacted by axios-retry' , async t => {
590610 let client = createClient ( ) // eslint-disable-line
591611 const axios = require ( 'axios' )
You can’t perform that action at this time.
0 commit comments