infinitered / apisauce

Axios + standardized errors + request/response transforms.
MIT License
2.78k stars 184 forks source link

Add testing example to README #309

Closed theSteveMitchell closed 1 year ago

theSteveMitchell commented 1 year ago

https://github.com/infinitered/apisauce/issues/50 was helpful for me to understand an unexpected issue with testing. Hopefully it'll be helpful to others who have similar issues.

In my case, we are using axois-mock-adapter for mocking api requests. I think this is an extremely common package and pattern. We upgraded apisauce from 1.21.2 to 1.21.4, and all of the mocks stopped working.

@skellock's comment helped us to identify the issue, and when we looked through the code we found that 1.21.3 clones the axios instance which was not happening in 1.21.2. I wasn't able to find anything in release notes about that, and we didn't expect this to change in a minor/patch release

jamonholmgren commented 1 year ago

Good idea, @kevinvangelder

theSteveMitchell commented 1 year ago

Yea, good suggestion @kevinvangelder. I've pushed that update. I wish we could do syntax highlighting with diff, but it is easier to follow with the diff 👍

jamonholmgren commented 1 year ago

Thanks for the contribution @theSteveMitchell !! Really appreciate it!

infinitered-circleci commented 1 year ago

:tada: This PR is included in version 3.0.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: