Open mei33 opened 5 years ago
try using setTimeout instead of $nextTick, not sure why it matters but it worked for me.
hey, thanks for advice. sounds strange, but hope it'll help. i'll try it
On Wed, May 22, 2019 at 11:49 PM ZaneDev notifications@github.com wrote:
try using setTimeout instead of $nextTick, not sure why it matters but it worked for me.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ctimmerm/axios-mock-adapter/issues/196?email_source=notifications&email_token=AEK2BXB3RINN26PRZR2EYSDPWV2TNA5CNFSM4HCQ2AGKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODV7VGNA#issuecomment-494883636, or mute the thread https://github.com/notifications/unsubscribe-auth/AEK2BXBT3ZF6D4HA7NRSOP3PWV2TNANCNFSM4HCQ2AGA .
-- Андреев Максим Александрович +7-923-331-3772
I have simple Vue component that fetches API key when it is created and key can be renewed by clicking on button:
And I want to test it with this code:
But it turns out only get request is mocked because i receive:
Even worse,
console.log(mockAxios.history)
returns empty put array:I tried to define mockAxios in describe block, and console.log it after iteration - and it turns out that put request was here. But not when I needed it. :)
What am i doing wrong? Maybe there are some ways to check if created callback was called and all async functions inside it are done? Maybe i'm using axios-mock wrong?