The value returned from axios-mock-adapter mock definitions must be an AxiosHeaders object, otherwise the instance reference will be changed.
axios does not expose AxiosHeaders constructor.
While not a bug, axios@v1 still has a problem for testability.
Returning response headers on mock response definition won't work anymore in some cases. The dirty hack will be needed, otherwise we need to make it exposed in axios core.
🤮 Fix
axios
andaxios-mock-adapter
compatibility issue on tests 🤮 by mpyw · Pull Request #48 · mpyw/axios-case-converterReturning response headers on mock response definition won't work anymore in some cases. The dirty hack will be needed, otherwise we need to make it exposed in axios core.