I expect when stubbing axios client calls with certain args to be able to assert that they have been called in the domain logic/flow at a certain order. But the test passes always.
For example, axiosPostStub.withArgs(...args1) and axiosPostStub.withArgs(...args2) are two different stubs which get called only if the domain logic passes the args1 and args2 to the post function of the axios client. So far so good.
What I want to test is that these two stubs are being called in a exact manner one after the other. For example: axiosPostStub.withArgs(...args1) is the first to get called in the code being tested. The second one is axiosPostStub.withArgs(...args2)
Once I save these stubs in a variable and try to assert them either by callOrder from sinon or stub1.calledBefore(stub2), the test passes, nevermind that I changed the order of execution. What am I missing? Or is there something undocumented?
Cheers
Aucun commentaire:
Enregistrer un commentaire