[Vuejs]-Vue-test-utils doesn't track object props?

0👍

When your component have async methods, like fetch user fields on mounted, you have two options when testing:

Option 1: Test with an async function and await for the nextTick
Option 2: Use the package flush-promises

Both options are detailed in the vuejs test utils documentation with examples.

Also, you can mock axios response with some data for populate your user fields without a real fetch to your backend.

Leave a comment