testing-library / vue-testing-library

🦎 Simple and complete Vue.js testing utilities that encourage good testing practices.
http://testing-library.com/vue
MIT License
1.09k stars 109 forks source link

Using external libraries #140

Closed jdriesen closed 4 years ago

jdriesen commented 4 years ago

Hi,

First of all, thanks for sharing this great library. It's really a great help !

I'm having a small question about using external libraries. e.g. I would like to use to the jest-image-snapshot library.

Can you give me a some info about best practices ? (an small example would be really great...)

Thanks in advance for your reply,

Kind regards, Johnny Driesen Belgium

afontcu commented 4 years ago

Hi! Thank you for your kind words :)

I've never used this library before, but seems like you just need to pass in some DOM nodes, right? You could get container or baseElement from render(), and pass it down to jest-image-snapshot.

jdriesen commented 4 years ago

Thanks for your quick reply, @afontcu . Gonna give it a try. (though, I've to say I'm rather new to Vue Testing )

BTW: Thanks for all your documentation ! That's really a great help for a newbie like me.

afontcu commented 4 years ago

Thanks! Going to close this up, feel free to ask for help in Spectrum and open new issues in the repo for potential bugs or missing features :)

jdriesen commented 4 years ago

If I can ask ...

Can you give me a little help, please ?

afontcu commented 4 years ago

any particular reason why you're using kdc-scripts in your demo ? (confuses me a bit)

Because Vue Testing Library is part of the Testing Library family, and almost all other projects use kcd-scripts as well. This way we can keep things similar across projects.

Seems that upgrading @vue/test-utils": "^1.0.0-beta.32 to the latest version (i.e. 1.0.2) breaks everything...

Yep, that's quite expected. We're working on it here: https://github.com/testing-library/vue-testing-library/pull/139

Hope this helps!

jdriesen commented 4 years ago

Once again, thanks for your quick reply. Thanks to you, I've learned already a lot today.

And I promise, next time, I'll use Spectrum for my questions.