-
Notifications
You must be signed in to change notification settings - Fork 247
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
onGet reusing wrong reply #347
Comments
Yes, you are right. Got the same error. |
@macskay I go through the source code. What I found is if we create new axios instance every time, then it will work. This is not the problem with onGet. This problem come up in every HTTP methods if we use the same url. |
Hello @marcbachmann @ctimmerm If |
I get the same bug
|
any update on this ? is this an known issue or it's specific my stack ? (nextjs, jest, testing library) ? |
Most issues I've seen were jest related as they have been doing weird things in the past. I wonder whether this is fixed by upgrading to const declarations and a class. Could somebody try to run the tests with the changes there. |
I tried in localhost with the PR, but it don't seams to resolve the issue But i'm not sure to have done it really well, sorry The tests are passing |
an isolated test case would be good. 🤔 |
In my case, I am using |
I have multiple tests in one file, one is to check whether the state is changed correctly if the response returns 200. The other should check if a 401 is handled correctly. When I run them separately, meaning I comment one of the two out the work fine. However when running them side-by-side the second one returns the reply from the first one.
Here is my file
When inspecting
mock.history
the history of the second test is empty, where as for the first one the get shows. Am I missing sth here?One addition: The axios call I'm stubbing is called on beforeMount in my Vue Component, which is why I mount it after setting up the mock instead of setting the wrapper in beforeEach of the test file.
The text was updated successfully, but these errors were encountered: