New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not compatible with axios version 0.27.2, which is in package.json #338
Comments
Yes, I'd happily accept a PR for this.
That version bump is btw not relevant, that's part of the devDepedencies, which is only used when running tests locally. axios-mock-adapter does not itself have axios as a dependency, it's only listed as a peer depedency, which means that the version of axios that is used is chosen by the project that uses axios-mock-adapter, not by axios-mock-adapter itself. |
Gotcha. In that case I have a question about the version management: Wondering how this library can support axios pre 0.27 and 0.27+ at the same time. Or the PR would be merged into v2.x of Basically how would someone automatically have the correct version of this library based on their version of axios. |
We have in the past supported multiple incompatible versions of axios simultaneously. This can be done by doing feature detection, e.g. in this case we know that |
Got it. I will try and work on an MR for this , first without the handling part, then add that in and see if it is sufficient. Thanks for your responses. |
In this commit support for axios
0.27.2
was introduced via version bump in package.json.However, axios v0.27 introduces breaking changes which are not properly implemented in https://github.com/ctimmerm/axios-mock-adapter/
Specifically, the error handling is now using a class
AxiosError
-> axios/axios#3645However, this library continues to use the old way of generating an axios error ->
axios-mock-adapter/src/utils.js
Line 135 in b880444
As a result, tests fail when some error handling logic for the new axios is tested, as the error from this library is not able to be handled.
This accidental version bump may have come from the assumption that minor version should not have any breaking changes, however as per SemVer in the development stage (0.y.z) anything may change at any time. Ref: https://semver.org/#spec-item-4
Would you accept a PR to fix this?
The text was updated successfully, but these errors were encountered: