Jest Crash Course - Unit Testing in JavaScript

Поделиться
HTML-код
  • Опубликовано: 19 дек 2024

Комментарии • 300

  • @n_fan329
    @n_fan329 5 лет назад +326

    56:04 PLEASE !!! don't ever say sorry bro, contrary you are a LIFE SAVER and we should all of us thank you 👍👍👍👍

    • @sumnickd
      @sumnickd 4 года назад +11

      I vibe with this comment SO hard

    • @pingnikhil
      @pingnikhil 4 года назад +3

      Couldn't agree more! However now, you must say "sorry" for saying "sorry". :-)

  • @joydeepr007
    @joydeepr007 6 лет назад +87

    I got placed in Thomson Reuters.
    A many many thanks to you sir, keep giving us such education always, I have learned a lot from you.
    Thank You.

  • @rayc3103
    @rayc3103 6 лет назад +42

    Brad,, I just got a new job (with the help of your videos, of course). One of my first assignments at my job was to create a form with Material UI. I went through a bunch of docs online, but still didn't understand the grid system. I went through your crash course in a half hour and learned what I needed to finish. Thank you for the videos.

  • @BEARCLAWQ
    @BEARCLAWQ 4 года назад +11

    This made far more sense to me than the 4 hour course I just watched on Pluralsight. Thank you and please do more.

  • @alex_blue5802
    @alex_blue5802 Год назад +1

    I love this. I already feel so much more confident with Jest.

  • @karma_yogi_42
    @karma_yogi_42 4 года назад +2

    what a life saver! got interview in 1 hr and this will help a lot
    gold. absolute gold

  • @AliihsanErtugrul-b2m
    @AliihsanErtugrul-b2m 5 месяцев назад

    I watch a lot of jest testing videos but I definitely say that you are the best instructor

  • @aduhaneh1057
    @aduhaneh1057 5 лет назад

    Thank god this is free. Just watched a series of same topic that stopped halfway because the rest of the series is behind a paywall. You're a good man! Thank you!

  • @kirillvoloshin2065
    @kirillvoloshin2065 3 года назад +1

    you are a legend, Brad!
    I have just added unit testing to my project to check the whole js file with database calls (had to wrap the file and add custom database call functions to imitate calls and response).
    Jest tests are great since I no longer need to manually test for cases like I used to for previous 2 years!

  • @lukasluftlaufer1093
    @lukasluftlaufer1093 2 года назад

    I don't know how many times I've already wrote this comment under one of your videos, but: Thanks a ton, Brad! You are the best.

  • @StrangeIndeed
    @StrangeIndeed 4 года назад +26

    Now I've realized why is it called Jest. It's 'Test', but instead of T, there's J - for JavaScript

  • @pyakz6474
    @pyakz6474 3 года назад

    been watching this guy since last year, now i am employed.

  • @joem8251
    @joem8251 6 лет назад +1

    Your tutorials may be the best! Your concise presentation, your habit of citing requirements for doing X, and how you organize concepts with top-level descriptions that accompanies details are helpful. My favorite part of your presentation style is how you say a lot with very little but elaborate where necessary with minimal redundancy.
    Another Example: "We could have installed JEST globally and use JEST commands, but here we install JEST locally and use a script" -- that is extremely useful for beginners learning on their own who may become frustrated if they don't know to look for the difference while exploring other resources.

  • @GooseGumlizzard
    @GooseGumlizzard 5 лет назад +1

    YES. I just finished your crash course videos on Node and Express, next on my list was Jest, i search it up and was so relieved to see that you made a video on it as well. You're the best on the web, Brad!

  • @tommyleong8328
    @tommyleong8328 3 года назад +2

    Appreciate on your video content. As a beginner picking up Jest, your guide is really helpful. Thank you!

  • @AhmedOsama5
    @AhmedOsama5 6 лет назад +8

    this guy is really good and helpful
    make sure you play 1.5 speed while watching

  • @praveenpoonja95
    @praveenpoonja95 3 года назад

    I wanted to watch this video for 10 minutes and continue watching tomorrow but this video was so mesmerising that I completed watching full video. Thank you Brad😊

  • @deepumon.d3148
    @deepumon.d3148 9 месяцев назад

    This is the first video I have never skipped in any point.

  • @cyntler-softwaredeveloper637
    @cyntler-softwaredeveloper637 6 лет назад +1

    Jest is the best JavaScript testing framework in my opinion. Thank you Brad for video!

  • @marsdwarf
    @marsdwarf Год назад +1

    Perfect, this tutorial has examples and is easy to follow. Thanks!

  • @kramseyart7663
    @kramseyart7663 2 года назад +1

    Hey Brad, thanks so much for these videos! I've been following for years, and attribute half of my success in landing a job as a software engineer to looking up most missing info/references from your content :) Despite being on the job for 9 months now, I still find myself struggling to write unit tests, and turned to this video for a refresher. Seems like a great intro/beginner tutorial, thought I have a hard time finding any material online that really gives a solid intermediate-to-advanced level of Jest education. If you think it would be worthwhile, I would personally love to see an updated, comprehensive Jest tutorial that defines variables via DOM traversal and testing nested if/else conditions, explains ShallowWrapper vs ReactWrapper, and tests updated views after changing state, etc. Again, I haven't seen anything like this done before, so might be something to look into - and I know I'd certainly appreciate having a high quality reference point in the future as well! Thanks for the time, keep up the amazing work!

  • @adamboostani6237
    @adamboostani6237 5 лет назад +9

    Excellent introduction. Looking forward to the advance course!

  • @aniruddharaje8
    @aniruddharaje8 2 года назад +3

    Love your courses Brad, I have been a big fan over the years and I suggest your awesome courses to all of my friends and colleagues, you have massively helped so many people in need of clearing concepts in simple language. Big love from India 🙏

  • @nilana9107
    @nilana9107 3 года назад +1

    Awesome video thanks a lot Brad ...hopefully understood concepts,please let’s go and deep dive into jest+puppeteer

  • @ryanchristensen643
    @ryanchristensen643 5 лет назад +1

    Thank you! I recently got hired as a developer and your videos have helped me a lot! The way you describe things makes it easier to grasp the concepts, keep up the good work :)

  • @jefjef418
    @jefjef418 6 лет назад +135

    I love you traversy media

  • @samrey8134
    @samrey8134 4 года назад

    I love you.... saved me dude...im in Interview mood for past 3 weeks... . ......

  • @paulthomas1052
    @paulthomas1052 3 года назад +1

    Great introduction to Jest Testing - really enjoyed the flow and content :)

  • @lavishjain4145
    @lavishjain4145 4 года назад +12

    When testing asynchronous code using async/await, you don't need the expect.assertions() line either.

  • @budkin
    @budkin 5 лет назад +4

    Your videos are clear, concise, and super useful. Thank you so much for everything you do Brad!

  • @jamesbrittan
    @jamesbrittan 6 лет назад +5

    This is a great intro to Jest, thanks. I would really like to see a video or series about how to use this in an app or more on test driven development practices generally.

  • @wengin
    @wengin 3 года назад +2

    Thank you very much for this tutorial and everything you publish! It's so helpful since you can explain very well, have the right speed and explain in an order that just makes you understand everything easily. I've been working as professional in a React project, have many years of Java experience and still learning Javascript, Typescript and everything and have been learning by reading code from our projects and RUclips tutorials. I've written a lot of tests, but wanted to get a good foundation on Jest. This tutorial has just been perfect for this purpose.

  • @tarunrv1
    @tarunrv1 5 лет назад +2

    Thank you so much!! This is just perfect! Got a headstart in Jest within an hour.

  • @mazaismaiss
    @mazaismaiss 4 года назад +1

    It was a fantastic journey through testing basics! Helped a lot!

  • @toddpowell6555
    @toddpowell6555 5 лет назад +3

    I really like that this video is generic JavaScript - It is NOT tied to frameworks like Angular, React, or Vue. This let me focus on JEST, instead of the frameworks.

  • @alexstulov7219
    @alexstulov7219 5 лет назад +6

    Thank you for saving my time learning all this from jest docs)

  • @ramseyj3024
    @ramseyj3024 6 лет назад +10

    Hey Brad please dont quit or give your channel away! Thanks

    • @simrandotdev
      @simrandotdev 6 лет назад

      Did you saw Devtips video recently lol ?

    • @TraversyMedia
      @TraversyMedia  6 лет назад +30

      That would never happen. I have already turned down pretty decent offers. This channel means much more to me than just money. The amount of people I am able to reach and help in any way is one of the most important things in my life

    • @simrandotdev
      @simrandotdev 6 лет назад

      Bless you man. You videos are of great help.

    • @TraversyMedia
      @TraversyMedia  6 лет назад

      Simranpreet Singh last i saw he had funfunfunction on it. Never worry about me abandoning the channel

    • @ubaidfarooqui
      @ubaidfarooqui 6 лет назад

      Hey Brad, yesterday I purchased your Mern course on Udemy, I am really thankful for your content in that course and also for this RUclips channel !

  • @steffen3
    @steffen3 2 года назад

    35:00 - reversestring has nothing to do with lower case. reversestring('Hello') should just be compared to 'olleH'. The correct way. But the rest of the video is just perfect. :D

  • @ideacodinglab
    @ideacodinglab 3 года назад

    This guy is awesome. I have no idea why he has just this number of subscribers!

  • @degisewmengist3260
    @degisewmengist3260 2 года назад

    All of your videos are very interesting and stick to the point. thank you.

  • @vikram87in
    @vikram87in 2 года назад

    still relevant after 4 years.. great video 😍

  • @dawidgaleziewski3335
    @dawidgaleziewski3335 5 лет назад +1

    That was great. Your content is just gold. Thank you for sharing Brad.

  • @shoto1673
    @shoto1673 2 года назад

    Thank you so much! It's kind hard to find a really good class about jest and you got to explain perfectly what I was looking for :) .

  • @smonkey001
    @smonkey001 6 лет назад +2

    A test environment setup with in-memory MongoDB and mongoose doing REST end point testing will be extremely helpful.

  • @doubleroti2010
    @doubleroti2010 5 лет назад +1

    This is awesome. I am in the process of learning unit testing and this was a brilliant intro video tutorial.
    Thanks :)

  • @davidrhodes7126
    @davidrhodes7126 6 лет назад +1

    Great refresher; Really helped me add some robustness to my test suites today.

  • @talkohavy
    @talkohavy 2 года назад +1

    13:16
    "Or as 99% percent of you call me - Tra↓ver↑sy↓"
    Im dyingggg 🤣🤣🤣 That's totally me!

  • @menandmice
    @menandmice 4 года назад

    You should use "slack off" instead of "slack on" Brad as far as I understand. But that is a small detail. You are an excellent instructor Brad!

  • @mfdebian
    @mfdebian 5 лет назад +1

    As always, great video Brad, to the point, concise and explanatory. Thanks!

  • @alokranjan476
    @alokranjan476 4 года назад +1

    Very nice and informative video Brad. I also watched a tutorial on PluralSight but this is far more better.
    Thanks a lot.
    I request you to bring a comprehensive video on Jest & Enzyme.

  • @MrBadcompany00
    @MrBadcompany00 6 лет назад +13

    I have a simple question. When someone ask ME where do you learn web dev things, i tell them Traversy Media, but where do/DID YOU learn all this stuff... you are awesome by the way

    • @bibibobs
      @bibibobs 6 лет назад

      MrBadcompany00 Reddit, GitHub, Medium and ofcourse documentation.

    • @MrBadcompany00
      @MrBadcompany00 6 лет назад

      WOLV Hey, is r/webdev on reddit 'the one ' for annountsments on tech and i wanna now what are good web sites for always kept up to date with web dev tech, and what do you mean by documentation, am failry new to this so sorry for asking

    • @bibibobs
      @bibibobs 6 лет назад

      MrBadcompany00 Just follow tech you're interested in for example: JavaScript, Node.JS or PHP. If there's a new framework then just read the documentation provided with it 😁

  • @kreeeeedz
    @kreeeeedz 6 лет назад +29

    I would like to see complex test such with classes and stubbing mocking dependencies like fetch data or write data to filesystem.

  • @altcoelho
    @altcoelho 6 лет назад +72

    Incredible. When can we expect(React Unit Testing w/ Jest and Enzyme).toBeTruthy( )?

    • @Jatin-nr1bj
      @Jatin-nr1bj 4 года назад +4

      yes please. This one sir. Right here.

    • @kjn5991
      @kjn5991 4 года назад +1

      yeah, I'm currently struggling with how to test functions inside function components (and how to pass the props to them).

    • @kannankdp2441
      @kannankdp2441 4 года назад

      +1

  • @adittttya
    @adittttya 2 года назад

    Thanks, man! Testing has always scared me. The fear is gone now!

  • @WorklLife
    @WorklLife 4 года назад

    Thanks for the examples of testing asynchronous code !

  • @dboland17
    @dboland17 3 года назад

    Thank you for making this video - really really helpful and very well explained. You are exceptionally clear.

  • @shail95
    @shail95 4 года назад

    Fantastic Tutorial for beginner! Great Job!

  • @paul_M007
    @paul_M007 6 лет назад

    Thank you for this video.. You have made Jest a lot easier for me !!!! Thank you!

  • @yusefkhan1752
    @yusefkhan1752 6 лет назад +15

    Excellent video. Liked before watching, and I know I won’t be disappointed.

  • @Codeytek
    @Codeytek 5 лет назад

    Explained it in a very simple manner. Good work!

  • @putenz87
    @putenz87 5 лет назад

    Brad please make a video on how to test dom manipulation with jest because that its really difficult to understand. You re the number 1

  • @MrBidalos
    @MrBidalos 6 лет назад +10

    How can/do you know/understand all these things??

  • @altcoelho
    @altcoelho 6 лет назад +2

    Thank you so much. I've been waiting for this Jest tutoruial!

  • @balazsorban
    @balazsorban 6 лет назад +3

    Please make more Jest videos! Maybe testing a React app with a mocked database? I would love to learn that. You are great!

    • @slicerabbit6166
      @slicerabbit6166 6 лет назад +1

      Jest has pretty good documentation on that.

    • @nareshvangari3815
      @nareshvangari3815 6 лет назад

      @@slicerabbit6166 hey, if you it have handy could ping the URL

  • @vinodsamudrala
    @vinodsamudrala 4 года назад

    Excellent beginning for jest
    l loved it.
    thank you so much 🙏🙏

  • @jgotty777
    @jgotty777 3 года назад

    how do you get Visual Studio Code to show the list of available functions at 6:12

  • @Syrviuss
    @Syrviuss 2 года назад

    Could anyony say why in 25:20 async did't work ? i get error like Cannot read properties of undefined (reading 'name') ?

  • @urbanpuma9136
    @urbanpuma9136 Год назад

    Thank you Brad. Your videos are super helpful 👍

  • @Booyamakashi
    @Booyamakashi 5 лет назад +2

    Jest is extremely slow. 8:42 - 1.5s for 2 asserts and 10 lines of code?

    • @jackiepuppet_5324
      @jackiepuppet_5324 5 лет назад

      I love Brad but JEST is seriously bad. None of these tests are even IO/CPU bound. Can you imagine a project with hundreds of unit tests and automation? I'd rather eat a bullet

  • @awaisfiaz8186
    @awaisfiaz8186 6 лет назад +36

    hey brad any video on docker???

  • @jymotwani
    @jymotwani Год назад

    This is awesome. For the more detailed version could you please include function mocking

  • @daryazat8049
    @daryazat8049 2 года назад

    32:35 How do you do it to have autocomplete here, I already tried some stuff but its doesnt work ..

  • @AnumitKaur0211
    @AnumitKaur0211 3 года назад

    Thanks a bunch !! This was super helpful for a newbie like me

  • @sampa6722
    @sampa6722 3 года назад

    This is amazing and you are one of the best tutors on youtube. the only question I have is, how to run a single suite? or a single file other than running everything together. In case we have hundreds of files, we don't have to run everything together. If Someone can help me here to understand, how to do that.

  • @mightysubbuswaroop
    @mightysubbuswaroop 5 лет назад

    Really nice introduction to jest... Thanks dude

  • @fotios4902
    @fotios4902 3 года назад +1

    Is there a second part yet coming? please...

  • @dinkarinjosh
    @dinkarinjosh 3 года назад +1

    how to enable ECMAScript module?

  • @madhuryavarshney3778
    @madhuryavarshney3778 4 года назад +1

    Sir can you also please let us know what extensions you use in the visual studio code , so the typing part becomes less for us too!

  • @eugenebarsky4780
    @eugenebarsky4780 5 лет назад

    49:40 How can the arrow functions variables initDatabase and closeDatabase be used before they were declared and assigned? Is there some special syntax for testing files?

  • @H1L1CH
    @H1L1CH 4 года назад

    Great video! Helped me a lot! Thank you for uploading it for free!

  • @calebrotich2120
    @calebrotich2120 5 лет назад

    When testing API request calls, it is recommended that you don't make actual API calls but instead mock the calls. There is a way of doing that.

  • @ymazalmazal1757
    @ymazalmazal1757 5 лет назад

    Wow, thank you so much for sharing and taking so much time to produce.

  • @eti-abasiumobong2500
    @eti-abasiumobong2500 3 года назад

    22:25 Async testing with axios

  • @priyanshubhardwaj2158
    @priyanshubhardwaj2158 3 года назад

    Guess what? You forgot to tag the Javascript Cardio videos.
    But that ain't hard to find since you're all over RUclips.
    Love

  • @gloriachen4415
    @gloriachen4415 5 лет назад

    Thanks a lot. Learn a lot from your unit testing lesson

  • @derek5218
    @derek5218 4 года назад

    May I know which VS extension that makes you able to auto-complete library provided methods? Thanks a lot.

  • @sdmc79
    @sdmc79 3 года назад

    Brilliant tutorial, really well explained! Thanks

  • @frayz38lyve
    @frayz38lyve 6 лет назад +2

    Thanks so much... You're my university!!

  • @sriramsoumya
    @sriramsoumya 4 года назад

    great course. include mock functions also in this

  • @tonyaltamura
    @tonyaltamura 5 лет назад +1

    is there a pratical difference between the use of test/expect and the more common sequence describe/it/expect?

  • @dilipsahu6382
    @dilipsahu6382 2 года назад

    if there is one function which takes multiple argument as an array and use console.log to print multiple values separately then how to test it.
    eg. function (input){
    for (let i = 0; i < input.length; i++) {
    if (input) {
    console.log(input[i]);
    }
    }

  • @davidofug
    @davidofug 4 года назад

    You're more amazing Brad Traversy.

  • @praveenreddyadelli8094
    @praveenreddyadelli8094 6 лет назад +1

    Wow, This is a awesome.
    It would be great help if you could also do advanced jest concepts like snapshot testing and all.

  • @rabatstadttv
    @rabatstadttv 4 года назад

    thanks for your tutorial brother, i really aperciate what you're doing.

  • @corsaronero5619
    @corsaronero5619 6 лет назад +4

    Hi Brad what about a video on Machine Learning. Thanks

  • @isaacquarshie2563
    @isaacquarshie2563 6 лет назад

    Traversy Media, You are the Best

  • @80Vikram
    @80Vikram 2 года назад

    I'm not getting auto complete for Jest properties and methods, did you install any plugin for VS Code ? Please clarify

  • @opium4880
    @opium4880 4 года назад +1

    This was great, thanks for the walkthrough :)

  • @moin6077
    @moin6077 4 года назад

    Hello. I am getting a TypeError: Cannot read property xxx of undefined. When I update my jest to 26.1.0. Otherwise it's working fine with jest 14.0.0. The file that it is throwing as undefined is present in my node_modules.

  • @ouba90
    @ouba90 4 года назад

    in chunkArray function, the constant last is an integer or an array?