Jest Crash Course - Unit Testing in JavaScript

Поділитися
Вставка
  • Опубліковано 15 вер 2024

КОМЕНТАРІ • 301

  • @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 роки тому +12

      I vibe with this comment SO hard

    • @pingnikhil
      @pingnikhil 3 роки тому +3

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

  • @rayc3103
    @rayc3103 6 років тому +41

    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.

  • @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.

  • @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.

  • @StrangeIndeed
    @StrangeIndeed 3 роки тому +25

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

  • @karma_yogi_42
    @karma_yogi_42 3 роки тому +3

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

  • @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!

  • @joem8251
    @joem8251 5 років тому +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.

  • @AhmedOsama5
    @AhmedOsama5 6 років тому +8

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

  • @AliihsanErtugrul-b2m
    @AliihsanErtugrul-b2m 2 місяці тому

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

  • @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!

  • @deepumon.d3148
    @deepumon.d3148 6 місяців тому

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

  • @alex_blue5802
    @alex_blue5802 Рік тому +1

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

  • @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!

  • @adarshanayak8392
    @adarshanayak8392 2 роки тому

    This was one of the best videos on JavaScript testing , I have watched on UA-cam.

  • @tommyleong8328
    @tommyleong8328 3 роки тому +2

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

  • @pyakz6474
    @pyakz6474 3 роки тому

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

  • @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😊

  • @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 🙏

  • @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.

  • @adamboostani6237
    @adamboostani6237 5 років тому +9

    Excellent introduction. Looking forward to the advance course!

  • @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.

  • @jefjef418
    @jefjef418 6 років тому +134

    I love you traversy media

  • @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!

  • @budkin
    @budkin 5 років тому +4

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

  • @ryanchristensen643
    @ryanchristensen643 4 роки тому +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 :)

  • @cyntler-softwaredeveloper637
    @cyntler-softwaredeveloper637 6 років тому +1

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

  • @marsdwarf
    @marsdwarf 11 місяців тому +1

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

  • @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 😁

  • @nilana9107
    @nilana9107 3 роки тому +1

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

  • @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.

  • @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 UA-cam 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.

  • @alexstulov7219
    @alexstulov7219 5 років тому +6

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

  • @lavishjain4145
    @lavishjain4145 4 роки тому +12

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

  • @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 UA-cam channel !

  • @tarunrv1
    @tarunrv1 4 роки тому +2

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

  • @smonkey001
    @smonkey001 6 років тому +2

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

  • @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

  • @mazaismaiss
    @mazaismaiss 4 роки тому +1

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

  • @ideacodinglab
    @ideacodinglab 3 роки тому

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

  • @paulthomas1052
    @paulthomas1052 3 роки тому +1

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

  • @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.

  • @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!

  • @doubleroti2010
    @doubleroti2010 4 роки тому +1

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

  • @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.

  • @vikram87in
    @vikram87in 2 роки тому

    still relevant after 4 years.. great video 😍

  • @talkohavy
    @talkohavy 2 роки тому +1

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

  • @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 :) .

  • @davidrhodes7126
    @davidrhodes7126 6 років тому +1

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

  • @mfdebian
    @mfdebian 5 років тому +1

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

  • @dawidgaleziewski3335
    @dawidgaleziewski3335 4 роки тому +1

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

  • @yusefkhan1752
    @yusefkhan1752 6 років тому +15

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

  • @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

  • @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

  • @degisewmengist3260
    @degisewmengist3260 2 роки тому

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

  • @adittttya
    @adittttya 2 роки тому

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

  • @steffens.1734
    @steffens.1734 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

  • @samrey8134
    @samrey8134 3 роки тому

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

  • @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.

  • @altcoelho
    @altcoelho 6 років тому +2

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

  • @dboland17
    @dboland17 3 роки тому

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

  • @WorklLife
    @WorklLife 4 роки тому

    Thanks for the examples of testing asynchronous code !

  • @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 UA-cam.
    Love

  • @jymotwani
    @jymotwani Рік тому

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

  • @paul_M007
    @paul_M007 6 років тому

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

  • @vinodsamudrala
    @vinodsamudrala 4 роки тому

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

  • @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.

  • @corsaronero5619
    @corsaronero5619 6 років тому +4

    Hi Brad what about a video on Machine Learning. Thanks

  • @shail95
    @shail95 4 роки тому

    Fantastic Tutorial for beginner! Great Job!

  • @frayz38lyve
    @frayz38lyve 6 років тому +2

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

  • @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!

  • @AnumitKaur0211
    @AnumitKaur0211 3 роки тому

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

  • @mightysubbuswaroop
    @mightysubbuswaroop 5 років тому

    Really nice introduction to jest... Thanks dude

  • @ymazalmazal1757
    @ymazalmazal1757 5 років тому

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

  • @H1L1CH
    @H1L1CH 4 роки тому

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

  • @rabatstadttv
    @rabatstadttv 4 роки тому

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

  • @igor_cojocaru
    @igor_cojocaru 5 років тому +1

    Hi Brad. Thank you for sharing your knowledge. Will you do some TDD series or intro to Test Driven Development tutorial? It would be great if you will do something like this with Jest and Cypress. Thanks a lot again!

  • @opium4880
    @opium4880 4 роки тому +1

    This was great, thanks for the walkthrough :)

  • @80Vikram
    @80Vikram 2 роки тому

    Thanks for this awesome tutorial on TDD, can you please make a video of building real world project TDD way ? Thanks in advance. In case you already have a video, please point to it.

  • @urbanpuma9136
    @urbanpuma9136 Рік тому

    Thank you Brad. Your videos are super helpful 👍

  • @sdmc79
    @sdmc79 3 роки тому

    Brilliant tutorial, really well explained! Thanks

  • @gloriachen4415
    @gloriachen4415 5 років тому

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

  • @MrBidalos
    @MrBidalos 6 років тому +10

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

  • @milanm6538
    @milanm6538 6 років тому +9

    Please make nexst step: Testing in React

  • @sriramsoumya
    @sriramsoumya 4 роки тому

    great course. include mock functions also in this

  • @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]);
    }
    }

  • @adriandinca5682
    @adriandinca5682 6 років тому +1

    Great job man! Just when I was getting into unit testing! :D Can you do a crash course one mocha as well? (I know you already have a video but I think it's a bit too short)

  • @lardosian
    @lardosian 5 років тому

    Thanks Brad, I'm gonna use this to test some React stuff.

  • @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.

  • @tonyaltamura
    @tonyaltamura 5 років тому +1

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

  • @roussafiomar5741
    @roussafiomar5741 2 роки тому

    thank you, perfect biginners tuto

  • @dhavalchheda1626
    @dhavalchheda1626 2 роки тому

    Hey Brad. Can you do a whole course for Jest, especially situations where the Unit testing is warranted. I think hard part is when to use rather than how to use.

  • @lucasfelipe-ze5sy
    @lucasfelipe-ze5sy 3 роки тому

    Brad, you're the best!

  • @stephh4392
    @stephh4392 6 років тому

    Hello, Brad, really love your videos, I am quite interested and would like to learn more about node.js and advanced JS project course, could u please do more videos on node.js, react and redux, please? Really curious how do u learn so much web stuff yourself and be so excellent in this? Really admire u! Thank you so much for making all these excellent videos, and I support you all the time!

  • @kamarajkannan9031
    @kamarajkannan9031 Рік тому +1

    how do we write an test for a function which is a void function?

  • @rawang45
    @rawang45 Рік тому

    This is extremely helpful, tq so much!

  • @immanueldiai8089
    @immanueldiai8089 4 роки тому +1

    Thank you so much for this great tutorial!

  • @chesterxp508
    @chesterxp508 6 років тому

    A very nice tutorial. Make a tutorial about events click, blur etc.

  • @karmindersinghbhatia7780
    @karmindersinghbhatia7780 4 роки тому

    best content on Jest