You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue: If a params object with any parameters is passed into an axios.get call, the moxios.wait function never causes the axios promise to execute.
I made a sample project to replicate the bug here: isolated_test_bug.zip There are two tests in the project: both of the tests should pass, but instead, one of them passes and one of them fails.
Here are the tests from the attached project above:
constaxios=require("axios");constmoxios=require("moxios");describe("moxios.wait",function(){letcounter;beforeEach(function(){moxios.install();});afterEach(function(){moxios.uninstall();});functionaxiosTest(params){moxios.stubRequest("test.com",{code: 200,response: "hello world"});counter=0;axios.get("test.com",{params: params}).then(function(){counter=1;});}// This test passes. Good!it("should work with an empty params object",function(done){axiosTest({});moxios.wait(function(){expect(counter).toBe(1);done();});});// This test fails, but it should pass.it("should work with a non-empty params object",function(done){axiosTest({"hello": "world"});moxios.wait(function(){expect(counter).toBe(1);done();});});});
I'm happy to share any other information that might be helpful. Thanks! :)
The text was updated successfully, but these errors were encountered:
Moxios version: 0.4.0
Axios version: 0.27.2
Issue: If a params object with any parameters is passed into an
axios.get
call, themoxios.wait
function never causes the axios promise to execute.I made a sample project to replicate the bug here: isolated_test_bug.zip There are two tests in the project: both of the tests should pass, but instead, one of them passes and one of them fails.
Here are the tests from the attached project above:
I'm happy to share any other information that might be helpful. Thanks! :)
The text was updated successfully, but these errors were encountered: