knee-cola / jest-mock-axios

Axios mock for Jest
252 stars 42 forks source link

Add eject functions to the interceptors #53

Closed webbushka closed 4 years ago

webbushka commented 4 years ago

When using interceptors there is an eject function that allows you to clean up after yourself. Right now those functions aren't mocked and my tests are throwing the following error

TypeError: axios.interceptors.request.eject is not a function

this change should fix that.

note: sorry for the extra commits, my editor changed the formatting quite a bit and I didn't realize it until I was creating the PR.
kingjan1999 commented 4 years ago

Hi,

thank you very much! I simplified the type declarations a little bit, apart from that your changes look great!