This repository has been archived by the owner on Dec 19, 2023. It is now read-only.
Replies: 1 comment 1 reply
-
The 'correct' way, as least according to the original PR and test, would be to pass This should work for the test you've got set up:
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to set up our Nuxt 3 application with nuxt-vitest to test our components, composables, utils and whatnot.
I got the setup running and it successfully tests simple Javascript util functions. Now I want to test a component. Let's say I have a Button component which has a prop of text and i simply want to check if the text gets rendered. I tried mocking the component and passing the props into it and then check for the given text via testing-library.
Here is an example
Unfortunately this does not work and as far as I can see the documenation isn't very detailed on this at the moment. Maybe we could extend the documentation on the mockComponent part and extend the example in the playground
I would like to understand what would be the best way to test a component in nuxt-vitest and would appreciate any pointers in the right direction.
Beta Was this translation helpful? Give feedback.
All reactions