ctimmerm / axios-mock-adapter

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

timeout returns 'ECONNABORTED' instead of 'ETIMEDOUT' #336

Closed Seb-C closed 1 year ago

Seb-C commented 2 years ago

In Axios, it is possible to use this configuration to get explicit timeout errors:

transitional: {
    clarifyTimeoutError: true,
},

When doing that, I get the error code ETIMEDOUT instead of ECONNABORTED in Axios.

However, the timeout method of this adapter always returns ECONNABORTED, so it's not possible to properly test this scenario.