I want to stub the entire axios object using sinon. My axios call is like
const response = await axios({
method,
url,
headers,
data,
});
I have found out that if my call was like
const response = await axios.get(url, data);
Then I could stub the function like
sinon.stub(axios, "post").resolves(mockResponse);
But this is not working for the axios()
call, but only for axios.post()
.