Avoid testing implementation's detail #6938
darderemedy
started this conversation in
Feedback
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently I'm working with a Vite VueJS 3 project, and I'm using vitest with Testing Library Vue. Testing Library allows us to test "user behavior" instead of "implementation's details". I mean, instead of testing if a function was called, I test how the screen looks like after a user interacts with a button (for example).
If I test all possible user interactions within a screen, I should cover 100% of this file. However, Vitest states there are a lot of lines, statements, and functions uncovered.
Is there a way to say to Vitest ignore implementation's details and focus only on user behavior?
This works for React using Testing Library React, but I couldn't accomplish the same result with VueJS.
Beta Was this translation helpful? Give feedback.
All reactions