ctimmerm / axios-mock-adapter

Axios adapter that allows to easily mock requests
MIT License
3.45k stars 244 forks source link

Throw ETIMEDOUT on timeout when clarifyTimeoutError is true #352

Closed askielboe closed 1 year ago

askielboe commented 1 year ago

Fix bug where timeout() and timeoutOnce() would throw ECONNABORTEDinstead of the correct ETIMEDOUT, when transitional.clarifyTimeoutError was set to true.

Relevant Axios documentation:

    // throw ETIMEDOUT error instead of generic ECONNABORTED on request timeouts
    clarifyTimeoutError: false,

Source https://github.com/axios/axios/blob/v1.x/README.md#request-config.

Closes https://github.com/ctimmerm/axios-mock-adapter/issues/336.

marcbachmann commented 1 year ago

I've rebased. Basically this project doesn't have any optional chaining operator yet. Let's see whether tests succeed.

cure-tmk commented 1 year ago

@marcbachmann Are there any plans for when this will be released?