Fast Unit Testing With Vitest

Sdílet
Vložit
  • čas přidán 2. 02. 2023
  • Vitest is a Vite-native unit testing framework that’s Jest-compatible. Core maintainer Anthony Fu will teach us how to use it in this episode.
  • Věda a technologie

Komentáře • 35

  • @olatunjiolakunle6908
    @olatunjiolakunle6908 Před rokem +11

    Anthony Fu has been a huge blessing to the Vue community. Thanks Jason for having him on.

  • @nandoomb
    @nandoomb Před rokem +18

    Man... I don´t understand... Why are you with only 34k subscribers? Your channel is one of the best when we talk about programming. Keep doing your job as you do. Congrats man! 💪🏽

  • @_the_one_1
    @_the_one_1 Před rokem +14

    Anthony Fu! THE LEGEND himself! Thank you Jason

    • @learnwithjason
      @learnwithjason  Před rokem +3

      it was such a pleasure having Anthony on the show 💜

  • @bojack4800
    @bojack4800 Před rokem +1

    thanks for your video, it's wonderful!

  • @PerpetualEducation
    @PerpetualEducation Před rokem +1

    Excellent discussion!

  • @WIMS-Cardano-ud5rw
    @WIMS-Cardano-ud5rw Před 7 měsíci

    Awesome collaboration.

  • @mickwhyte4204
    @mickwhyte4204 Před měsícem

    Great intro guys. Thanks.

  • @khairulhaaziq2332
    @khairulhaaziq2332 Před rokem +2

    Wow hahah so they started out with a name. Damn! Another exciting episode Jason

    • @learnwithjason
      @learnwithjason  Před rokem

      proving that domain-name driven development DOES work! 💀

  • @kousheralam8657
    @kousheralam8657 Před rokem

    Very good presentation

  • @IainSimmons
    @IainSimmons Před rokem

    I've got a old Gatsby project at work that uses Jest snapshots and this makes it look practically ancient!

    • @Benjamin-Chavez
      @Benjamin-Chavez Před 3 měsíci

      This comment made me stop second guessing my choice to use vitest instead of jest. 🙏

  • @mumk
    @mumk Před rokem +5

    Anthony the legend

  • @abuzain859
    @abuzain859 Před 7 měsíci

    HeyJason!
    I watched your video and it is awesome . Now i am using the Vitest in my project but I am getting this error :
    ( Not implemented: window.computedStyle(elt, pseudoElt)
    at module.exports (C:\Users\Faizan\Desktop\full-stack
    ode_modules\jsdom\lib\jsdom\browser
    ot-implemented.js:9:17) )

  • @Gaijin101
    @Gaijin101 Před 5 měsíci

    The man The legend

  • @HG-wu6eb
    @HG-wu6eb Před 10 měsíci

    Hello!
    May i ask you a question?
    How can we write unit tests in Nuxt 3 application? I tried '@nuxt/test-utils', 'vitest', Vue testing library, 'nuxt-vitest' and something else (I don't remember everything I tried to use as spent so much time to figure out in that).
    I could write test to test simple calculating functions and that was all.
    No ability to get DOM element, to simulate user event, to check if some function was invoked, to check state updates - nothing really valuable tests could be written.
    Could anybody please advise me where to find the solution?
    Thank you!

    • @hungify
      @hungify Před 6 měsíci

      It works which doesn't have any problem.
      Perhaps, do did it the wrong way.

  • @ermakamre
    @ermakamre Před rokem +2

    Very cool episode! Vite ecosystem is so good that I might start looking at using Vue instead of React.

  • @captainalpha4853
    @captainalpha4853 Před 7 měsíci

    what's the name of the extension you're using to kind of 'translate' the error and simple terms like at 49:29? Thanks for the video!

    • @learnwithjason
      @learnwithjason  Před 7 měsíci +2

      this is Matt Pocock’s Total TypeScript extension: www.totaltypescript.com/vscode-extension

    • @captainalpha4853
      @captainalpha4853 Před 7 měsíci

      @@learnwithjason thank you!

  • @jiaqi222
    @jiaqi222 Před 10 měsíci

    HI, Jason, what browser are you using? I'm dying to know!

  • @vengateshvaidyanathang550

    Hey man the way you do this pair programming podcast is really !! Nice . It would be nice if I had also get same set of font styles you show in these podcasts can you please help to get it to my vscode 😅 tried googling but doesn’t work !!

    • @learnwithjason
      @learnwithjason  Před 12 dny +1

      thanks! I use the Night Owl theme in VS Code with Operator Mono as my font

  • @ysupriyadi123
    @ysupriyadi123 Před rokem +1

    Function testing is already fast enough. I expect to see React testing here cause it is really slow with testing library 😥

  • @jsonkody
    @jsonkody Před 8 měsíci

    Wow .. main panel on right side .. interesting idea :O Why I did not try it ever before?
    It's possibly better. I Always hated how the navigation shifting my code, constantly playing with width, switching it on/off etc.
    Thx :)

    • @learnwithjason
      @learnwithjason  Před 8 měsíci

      yeah, I wanted to hate it at first but it really feels better for me

  • @katteos
    @katteos Před rokem

    Amazing Jason

  • @zahramohammadpour6689
    @zahramohammadpour6689 Před 11 měsíci

    OMG !!!

  • @oanacristea2572
    @oanacristea2572 Před 11 měsíci +3

    You need to clear out the mock before or after each test. There are a few way to do so. I think something like this might work:
    ```afterEach(() => {
    vi.clearAllMocks();
    vi.resetAllMocks();
    });```

  • @kmylodarkstar2253
    @kmylodarkstar2253 Před 3 měsíci

    Amazing video, really nice to work with vitest instead of jest, lovely DX.
    % @vitest/coverage-v8 does not work on Stackblitz. Report will be empty.