This repository was archived by the owner on Feb 13, 2024. It is now read-only.
File tree 2 files changed +21
-1
lines changed
2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change 22
22
"circle-lint" : " .buildscript/circle.sh" ,
23
23
"dependencies" : " yarn" ,
24
24
"size" : " size-limit" ,
25
- "test" : " standard && nyc ava && .buildscript/e2e.sh" ,
25
+ "test" : " standard && nyc ava --timeout=20s && .buildscript/e2e.sh" ,
26
26
"report-coverage" : " nyc report --reporter=lcov > coverage.lcov && codecov" ,
27
27
"np" : " np --no-publish" ,
28
28
"release" : " yarn run np"
Original file line number Diff line number Diff line change @@ -72,6 +72,12 @@ test.before.cb(t => {
72
72
} )
73
73
}
74
74
75
+ if ( batch [ 0 ] === 'axios-retry-forever' ) {
76
+ return res . status ( 503 ) . json ( {
77
+ error : { message : 'Service Unavailable' }
78
+ } )
79
+ }
80
+
75
81
res . json ( { } )
76
82
} )
77
83
. listen ( port , t . end )
@@ -586,6 +592,20 @@ test('ensure that failed requests are retried', async t => {
586
592
await t . notThrows ( client . flush ( ) )
587
593
} )
588
594
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
+
589
609
test ( 'ensure other axios clients are not impacted by axios-retry' , async t => {
590
610
let client = createClient ( ) // eslint-disable-line
591
611
const axios = require ( 'axios' )
You can’t perform that action at this time.
0 commit comments