ctimmerm / axios-mock-adapter

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

Handle request with undefined url #274

Closed novascreen closed 4 years ago

novascreen commented 4 years ago

I'm dealing with a 3rd party library that uses Axios and only defines baseURL without url for some reason. This results in an error because the request handler tries to call substr on undefined.

I simply added a fallback to an empty string for the url and added a test for it.

ctimmerm commented 4 years ago

Thanks!

novascreen commented 4 years ago

hey @ctimmerm, i was wondering if you could publish a release with this? it would be nice to clean up the workaround i need to do right now 🙏