-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
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
Tests No Longer Passing since Upgrading to v1.5.0 #5844
Comments
I try this in vitest.setup.ts import axios from 'axios';
beforeAll(() => {
axios.defaults.adapter = 'xhr';
}); |
Had several |
tytyty!!!! also had broken tests, this fixed it! |
Also seeing this in our app and can confirm that setting the adapter to xhr fixes the issue for us as well. Do we have any idea what's causing this? |
The same issue using |
Basically #5837 contains a breaking change and maintainer should have bumped major version instead of releasing 1.5.0 |
Got it. So, this looks like it should be fixed now? |
I actually got the exact (?) same issue by upgrading from 1.5.0 to 1.5.1 :
Downgrading to 1.5.0 removes the error on my case. The above solution does not work for me. Errors still here. |
axios.defaults.adapter = 'http' |
Describe the bug
After upgrading axios from 1.4.0 to 1.5.0, tests that use network calls all fail consistently.
In my tests, I use Vitetest with Pretender intercepting network calls. None of my network tests pass with axios
1.5.0
. I get the following error messages:Can confirm this is from axios. Downgrading back to
1.4.0
resolves the problem.To Reproduce
Using the last version of Pretender and an axios instance using v1.5.0, attempt to intercept a network call in a test environment, using Jest or Vitest.
Code snippet
No response
Expected behavior
Pretender should be able to intercept network calls in the test environment.
Axios Version
1.5.0
Adapter Version
No response
Browser
No response
Browser Version
No response
Node.js Version
20.4.0
OS
Mac OS 13.4
Additional Library Versions
Additional context/Screenshots
The text was updated successfully, but these errors were encountered: