ctimmerm / axios-mock-adapter

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

feat(hardening): ensure that an instance is provided to mock #300

Closed justinweisberg closed 3 years ago

justinweisberg commented 3 years ago

Hey there! This is my first public PR so if I need to change anything please let me know! I was using this library for a project and ran into an issue when we accidentally attempted to instantiate a mock instance against an empty import. Hopefully this saves some folks some time in the future.

• Throw an error if there is no axios instance available to mock • Test failing constructor

ctimmerm commented 3 years ago

Thanks, this is great!