-
Notifications
You must be signed in to change notification settings - Fork 112
Wrapper from vue-test-utils not exposed? #46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi! 👋 and thanks for your question. Vue Testing Library tries to follow the Testing Library Guiding Principle. Since we are trying to focus on rendering components instead of dealing with component instances, it wouldn't make much sense to provide a tool that helps testing you the exact opposite - if a given wrapper is a Vue instance. That's the reason behind not providing such method. In Vue Testing Library world, I'd just render the component and assert that the "initial state" is already there - the default strings, values, and so on. Hope I helped! |
Ah okay, so my use case is asserting that for my dumb component that an event is emitted on a certain click. Would you say it is good practice to mix tests importing |
Check out the simple button test example, because it looks quite similar to your use case:
hope it helps! |
Oh thanks! I missed the |
VTL exposes a The idea is that by using VTL you get the tools to test your components far from implementation details, so if you feel the urge to use a non-exposed method, I believe you'll find an available one that suits your needs. If not, let us know! ;) Thanks for your questions! Feel free to open up another issue if anything is unclear while using VTL 😄 |
In my case the component expects data from the store in deeply nested modules. I want to access the vm to set the store data that I need. I can do it via the options parameter when the data is in the root, but I'm having a lot of issues making it work when the data is in a deeply nested module |
Hi, I wanted to call something like
wrapper.isVueInstance()
like I would withvue-test-utils
. Looks like this wouldn't be possible in this library? Thanks.The text was updated successfully, but these errors were encountered: