ctimmerm / axios-mock-adapter

Axios adapter that allows to easily mock requests
MIT License
3.42k stars 241 forks source link

support for AbortController #342

Open nicks opened 2 years ago

nicks commented 2 years ago

From https://axios-http.com/docs/cancellation:

Starting from v0.22.0 Axios supports AbortController to cancel requests in fetch API way.

But as far as I can tell, this library only mocks the old cancelToken-based API: https://github.com/ctimmerm/axios-mock-adapter/issues/59

Would you be open to also supporting AbortController?

FlorianCassayre commented 1 year ago

Spent an hour setting up this library only to realize that it did not even support the AbortController.

JAspeling commented 2 months ago

Is this not what is used for aborting? https://github.com/ctimmerm/axios-mock-adapter/blob/4492f3c3b02c3e7054553b4f3190101b3d5b6a95/src/index.js#L133