7 ways to make your Vue unit tests better by Natalia Tepluhina

Sdílet
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

Komentáře • 9

  • @isfland
    @isfland Před 2 lety +22

    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')

  • @ribl1000
    @ribl1000 Před 2 lety +5

    The changes you mention are so subtle but so obvious when you point them out! Also, your pace of explaining these concepts is awesome!

  • @ajotel94
    @ajotel94 Před 2 lety +4

    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! 🥰

  • @l2cri
    @l2cri Před 2 lety +4

    Thanks..very helpful..

  • @alexanderopalic1873
    @alexanderopalic1873 Před 2 lety

    thank you awesome talk

  • @leuhenry8031
    @leuhenry8031 Před 2 lety

    Thanks from TianJin China

  • @MakeMeWhite19
    @MakeMeWhite19 Před 2 lety

    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.

  • @jo0o0oke3e3er
    @jo0o0oke3e3er Před 2 lety

    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.