Skip to content

Commit

Permalink
Merge branch 'main' into retry-instance
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinBeckwith authored Nov 16, 2023
2 parents e756baf + 731edbf commit ccef900
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,17 @@ describe('retry-axios', () => {
assert.strictEqual(scopes[1].isDone(), false);
});

it('should not retry if Retry-After is invalid', async () => {
const scopes = [
nock(url).get('/').reply(429, undefined, {'Retry-After': 'foo'}),
nock(url).get('/').reply(200, 'toast'),
];
interceptorId = rax.attach();
const cfg: rax.RaxConfig = {url, raxConfig: {maxRetryAfter: 1000}};
await assert.rejects(axios(cfg));
assert.strictEqual(scopes[1].isDone(), false);
});

it('should use maxRetryDelay', async function () {
this.timeout(1000); // Short timeout to trip test if delay longer than expected
const scopes = [
Expand Down

0 comments on commit ccef900

Please sign in to comment.