7 ways to make your Vue unit tests better by Natalia Tepluhina
Vložit
- čas přidán 19. 01. 2022
- Unit testing is hard. Unit testing Vue components is even harder. In this talk, I want to share some good testing practices developed over the years of my Vue experience. I hope they will help you improve your unit tests - or help you start writing them if you never did so!
Jobs -
Abyat is looking to hire talented developers for their new world class product. Apply now: www.abyat.com/careers?...
Looking to hire new developers? Post your jobs at vuejobs.com - Věda a technologie
Great tips, thanks!
Btw, to reduce lines of code in your unit tests, instead of
findIncrementButton().trigger('click')
await nextTick()
you can use
await findIncrementButton().trigger('click')
The changes you mention are so subtle but so obvious when you point them out! Also, your pace of explaining these concepts is awesome!
Wow, that's really something! Love how simple is that and at the same time - full of content, concise, meaty! I wish more presentations be like that! 🥰
Thanks..very helpful..
thank you awesome talk
Thanks from TianJin China
Does anyone know of some tutorials that follow this paradigm of testing? I'm new to JEST and would like to learn the correct way of testing.
14:15 i dont really agree withyou. sometimes you want to make sure that an event has an hook with a particular method. This check allow to aware that this hook could be potentially broken during some changes... and then change the unit test accordingly or, eventually, fix the source code.