[Vuejs]-Mock async action in Pinia

0👍

Ok… I found a solution (or a workaround, don’t know):

import { mount, flushPromises } from '@vue/test-utils'
// ...
await flushPromises()
expect(useRouter().push).toHaveBeenCalled() // OK

Leave a comment