Skip to content

What is the proper way of testing a component in Vue with API calls? #1749

Answered by cexbrayat
walmartwarlord asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @walmartwarlord

This test looks great to me. This is really close to what I would do and what I recommend in my book.

nit: flush promise is exposed by VTU, so you can import it from @vue/test-utils . And I would use the composition API for the component 😉

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@walmartwarlord
Comment options

Answer selected by walmartwarlord
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants