-
Notifications
You must be signed in to change notification settings - Fork 90
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
moxios.install() does not seem to install adapter #15
Comments
I think I've found my error: if I change the install/uninstall calls to pass "axios" everything works. Not sure why though... import moxios from "moxios";
import axios from "axios";
describe("moxios", () => {
it("mocks axios", () => {
console.log("Adapter before: ");
console.log(axios.defaults.adapter);
moxios.install(axios);
console.log("Adapter after installing: ");
console.log(axios.defaults.adapter);
moxios.uninstall(axios);
console.log("Adapter after uninstalling: ");
console.log(axios.defaults.adapter);
});
}); Looking at the moxios code it seems that it should not be necessary... |
I had the exact same problem. I just updated my axios version to the 0.15.3 and it worked just fine, even without passing axios to the call of moxios.install |
If moxios is using the same version of axios as your app, you shouldn't need to pass axios to |
Hi this is still a problem for me, and doing
|
Hi,
I'm trying to use moxios, but I find that the requests are performed as usual and moxios.requests.mostRecent() returns undefined.
It seems that moxios does not install any mock adapter.
Here's a minimal test:
Output:
I run the test with this command:
The text was updated successfully, but these errors were encountered: