ctimmerm / axios-mock-adapter

Axios adapter that allows to easily mock requests
MIT License
3.47k stars 245 forks source link

Support axios 1.x #382

Closed EranNL closed 8 months ago

EranNL commented 9 months ago

Are there any plans to support axios 1.x? I get a huge list of incompatible types when using axios 1.x (or I am doing something wrong).

afbeelding

Kenneth-Sills commented 8 months ago

@EranNL Were you able to find out more about this issue and how to fix/work around it? As far as I can tell, this seems to be caused by Tyescript choosing different .d.[c]ts files for the immediate file importing and the transitively imported one through the library and getting awfully confused.

I've been plucking away at this for a bit, so any help would be appreciated!

evelynhathaway commented 1 month ago

@Kenneth-Sills I am running into an identical issue to the one in this comment in another project https://github.com/softonic/axios-retry/issues/159#issuecomment-1809406232, which sounds similar to yours too.

I use axios-mock-adapter in Jest ESM to test files that import axios in ESM, but I think TypeScript is assuming axios-mock-adapter is using CJS to import axios.

I confirmed I have only have one deduped axios@1.7.7 and one axios-mock-adapter@2.1.0 across the project.

evelynhathaway commented 1 month ago

@Kenneth-Sills I created #400 for my issue in case it sounds related to yours