[Vuejs]-How Mock throw from axios

0👍

You say about mocking an Exception with axios?

I don’t know which library are you using.

For example with Sinon, I wrote like that:

let sandbox: sinon.SinonSandbox = sinon.createSandbox();

sandbox.stub(axios, "post").onFirstCall().returns(Promise.resolve(//Exception goes here))

Leave a comment