Open shaharsol opened 4 years ago
The following test doesn't pass. I'd expect the request to be aborted after 1000ms while axios-retry exponentially backs off, but it doesn't.
axios-retry
it('retries until fails due to timeout', async () => { nock('http://example.com') .put('/eventually-timeout') .times(4) .reply(503, 'service unavailable') .put('/eventually-timeout') .reply(201, { id: 2, name: 'John John Florence', }); try { const client = axios.create(); axiosRetry(client, { retries: 6, retryCondition: axiosRetry.isNetworkOrIdempotentRequestError, shouldResetTimeout: false, retryDelay: axiosRetry.exponentialDelay, }); await client({ method: 'put', url: 'http://example.com/eventually-timeout', timeout: 1000, }); throw new Error('shouldnt be here'); } catch (e) { expect(e.code).to.equal('ECONNABORTED'); } });
"dependencies": { "axios": "^0.19.2", "axios-retry": "^3.1.2" }
The following test doesn't pass. I'd expect the request to be aborted after 1000ms while
axios-retry
exponentially backs off, but it doesn't.