Jest Crash Course - Unit Testing in JavaScript

  Рет қаралды 431,862

Traversy Media

Traversy Media

6 жыл бұрын

In this video we will get started with JavaScript unit testing using Jest. We will look at how to setup Jest, different matchers as well as how to test async code, run functions before and after different tests, etc. This is for developers that are fairly new to testing and the Jest testing framework.
Code: Github Repo:
github.com/bradtraversy/jest_...
Sponsor: Anthrodesk
anthrodesk.com/
💖 Become a Patron: Show support & get perks!
/ traversymedia
Website & Udemy Courses
www.traversymedia.com
Follow Traversy Media:
/ traversymedia
/ traversymedia
/ traversymedia

Пікірлер: 302
@n_fan329
@n_fan329 5 жыл бұрын
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 жыл бұрын
I vibe with this comment SO hard
@pingnikhil
@pingnikhil 3 жыл бұрын
Couldn't agree more! However now, you must say "sorry" for saying "sorry". :-)
@StrangeIndeed
@StrangeIndeed 3 жыл бұрын
Now I've realized why is it called Jest. It's 'Test', but instead of T, there's J - for JavaScript
@greenstarlover1
@greenstarlover1 2 жыл бұрын
Surely you must jest.
@sab0004
@sab0004 Жыл бұрын
mind blown
@rayc3103
@rayc3103 5 жыл бұрын
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 жыл бұрын
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 3 жыл бұрын
This made far more sense to me than the 4 hour course I just watched on Pluralsight. Thank you and please do more.
@GooseGumlizzard
@GooseGumlizzard 5 жыл бұрын
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!
@tarunrv1
@tarunrv1 4 жыл бұрын
Thank you so much!! This is just perfect! Got a headstart in Jest within an hour.
@adamboostani6237
@adamboostani6237 4 жыл бұрын
Excellent introduction. Looking forward to the advance course!
@deepumon.d3148
@deepumon.d3148 Ай бұрын
This is the first video I have never skipped in any point.
@joem8251
@joem8251 5 жыл бұрын
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.
@alexstulov7219
@alexstulov7219 5 жыл бұрын
Thank you for saving my time learning all this from jest docs)
@kirillvoloshin2065
@kirillvoloshin2065 2 жыл бұрын
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!
@jamesbrittan
@jamesbrittan 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.
@budkin
@budkin 4 жыл бұрын
Your videos are clear, concise, and super useful. Thank you so much for everything you do Brad!
@ryanchristensen643
@ryanchristensen643 4 жыл бұрын
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 :)
@aniruddharaje8
@aniruddharaje8 2 жыл бұрын
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 🙏
@mazaismaiss
@mazaismaiss 4 жыл бұрын
It was a fantastic journey through testing basics! Helped a lot!
@altcoelho
@altcoelho 6 жыл бұрын
Thank you so much. I've been waiting for this Jest tutoruial!
@mfdebian
@mfdebian 5 жыл бұрын
As always, great video Brad, to the point, concise and explanatory. Thanks!
@alex_blue5802
@alex_blue5802 10 ай бұрын
I love this. I already feel so much more confident with Jest.
@jefjef418
@jefjef418 6 жыл бұрын
I love you traversy media
@AhmedOsama5
@AhmedOsama5 6 жыл бұрын
this guy is really good and helpful make sure you play 1.5 speed while watching
@karma_yogi_42
@karma_yogi_42 3 жыл бұрын
what a life saver! got interview in 1 hr and this will help a lot gold. absolute gold
@theunsalted
@theunsalted 2 жыл бұрын
How did it go ?
@wengin
@wengin 3 жыл бұрын
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 KZbin 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.
@doubleroti2010
@doubleroti2010 4 жыл бұрын
This is awesome. I am in the process of learning unit testing and this was a brilliant intro video tutorial. Thanks :)
@dawidgaleziewski3335
@dawidgaleziewski3335 4 жыл бұрын
That was great. Your content is just gold. Thank you for sharing Brad.
@davidrhodes7126
@davidrhodes7126 5 жыл бұрын
Great refresher; Really helped me add some robustness to my test suites today.
@ymazalmazal1757
@ymazalmazal1757 4 жыл бұрын
Wow, thank you so much for sharing and taking so much time to produce.
@Codeytek
@Codeytek 5 жыл бұрын
Explained it in a very simple manner. Good work!
@pyakz6474
@pyakz6474 2 жыл бұрын
been watching this guy since last year, now i am employed.
@aduhaneh1057
@aduhaneh1057 4 жыл бұрын
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!
@shoto1673
@shoto1673 Жыл бұрын
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 :) .
@praveenpoonja95
@praveenpoonja95 2 жыл бұрын
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😊
@tommyleong8328
@tommyleong8328 2 жыл бұрын
Appreciate on your video content. As a beginner picking up Jest, your guide is really helpful. Thank you!
@paulthomas1052
@paulthomas1052 3 жыл бұрын
Great introduction to Jest Testing - really enjoyed the flow and content :)
@paul_M007
@paul_M007 5 жыл бұрын
Thank you for this video.. You have made Jest a lot easier for me !!!! Thank you!
@immanueldiai8089
@immanueldiai8089 4 жыл бұрын
Thank you so much for this great tutorial!
@kramseyart7663
@kramseyart7663 2 жыл бұрын
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!
@opium4880
@opium4880 4 жыл бұрын
This was great, thanks for the walkthrough :)
@smonkey001
@smonkey001 5 жыл бұрын
A test environment setup with in-memory MongoDB and mongoose doing REST end point testing will be extremely helpful.
@lardosian
@lardosian 5 жыл бұрын
Thanks Brad, I'm gonna use this to test some React stuff.
@WorklLife
@WorklLife 4 жыл бұрын
Thanks for the examples of testing asynchronous code !
@mightysubbuswaroop
@mightysubbuswaroop 4 жыл бұрын
Really nice introduction to jest... Thanks dude
@cyntler-softwaredeveloper637
@cyntler-softwaredeveloper637 6 жыл бұрын
Jest is the best JavaScript testing framework in my opinion. Thank you Brad for video!
@alokranjan476
@alokranjan476 3 жыл бұрын
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.
@adarshanayak8392
@adarshanayak8392 Жыл бұрын
This was one of the best videos on JavaScript testing , I have watched on KZbin.
@vikram87in
@vikram87in Жыл бұрын
still relevant after 4 years.. great video 😍
@dboland17
@dboland17 2 жыл бұрын
Thank you for making this video - really really helpful and very well explained. You are exceptionally clear.
@vinodsamudrala
@vinodsamudrala 4 жыл бұрын
Excellent beginning for jest l loved it. thank you so much 🙏🙏
@sdmc79
@sdmc79 2 жыл бұрын
Brilliant tutorial, really well explained! Thanks
@mikea.cedric9337
@mikea.cedric9337 5 жыл бұрын
Amazing Video, Brad. Thank you!
@degisewmengist3260
@degisewmengist3260 Жыл бұрын
All of your videos are very interesting and stick to the point. thank you.
@samrey8134
@samrey8134 3 жыл бұрын
I love you.... saved me dude...im in Interview mood for past 3 weeks... . ......
@samerkayali4525
@samerkayali4525 3 жыл бұрын
Much thanks for your content. this tutorial is amazing!!
@urbanpuma9136
@urbanpuma9136 Жыл бұрын
Thank you Brad. Your videos are super helpful 👍
@nilana9107
@nilana9107 2 жыл бұрын
Awesome video thanks a lot Brad ...hopefully understood concepts,please let’s go and deep dive into jest+puppeteer
@talkohavy
@talkohavy Жыл бұрын
13:16 "Or as 99% percent of you call me - Tra↓ver↑sy↓" Im dyingggg 🤣🤣🤣 That's totally me!
@mikecastor2047
@mikecastor2047 4 жыл бұрын
Truly excellent video. Thank you!
@jannahhossain949
@jannahhossain949 2 жыл бұрын
absolutely amazing tutorial!
@abhishekchakole5070
@abhishekchakole5070 4 жыл бұрын
Thanks Brad for this tutorial
@kamrannazir2563
@kamrannazir2563 5 жыл бұрын
Thanks for these videos man.
@AnumitKaur0211
@AnumitKaur0211 2 жыл бұрын
Thanks a bunch !! This was super helpful for a newbie like me
@frayz38lyve
@frayz38lyve 6 жыл бұрын
Thanks so much... You're my university!!
@H1L1CH
@H1L1CH 3 жыл бұрын
Great video! Helped me a lot! Thank you for uploading it for free!
@thewatcher305
@thewatcher305 5 жыл бұрын
Absolutely amazing video!
@riothardy101
@riothardy101 6 жыл бұрын
Thank you brad :)
@shail95
@shail95 4 жыл бұрын
Fantastic Tutorial for beginner! Great Job!
@gloriachen4415
@gloriachen4415 4 жыл бұрын
Thanks a lot. Learn a lot from your unit testing lesson
@rabatstadttv
@rabatstadttv 3 жыл бұрын
thanks for your tutorial brother, i really aperciate what you're doing.
@praveenreddyadelli8094
@praveenreddyadelli8094 6 жыл бұрын
Wow, This is a awesome. It would be great help if you could also do advanced jest concepts like snapshot testing and all.
@kreeeeedz
@kreeeeedz 5 жыл бұрын
I would like to see complex test such with classes and stubbing mocking dependencies like fetch data or write data to filesystem.
@marsdwarf
@marsdwarf 7 ай бұрын
Perfect, this tutorial has examples and is easy to follow. Thanks!
@naveen-ib5ly
@naveen-ib5ly 5 жыл бұрын
Thanks u so much bro ...keeep up the good work
@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.
@himanshushekhar3694
@himanshushekhar3694 3 жыл бұрын
Thanks a ton for a detailed video!!
@elit5raax
@elit5raax 6 жыл бұрын
Thank you this is really helpful
@venkateshmanigandla8725
@venkateshmanigandla8725 3 жыл бұрын
Great video Brad. Thank you
@rawang45
@rawang45 Жыл бұрын
This is extremely helpful, tq so much!
@ideacodinglab
@ideacodinglab 3 жыл бұрын
This guy is awesome. I have no idea why he has just this number of subscribers!
@joepage3065
@joepage3065 2 жыл бұрын
Great tutorial. thanks for sharing.
@radovansurlak7445
@radovansurlak7445 5 жыл бұрын
Thank you Brad! :)
@MarcoSync
@MarcoSync 4 жыл бұрын
Awesome! Thanks Brad!
@igor_cojocaru
@igor_cojocaru 4 жыл бұрын
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!
@adriandinca5682
@adriandinca5682 6 жыл бұрын
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)
@aliplaysgtr
@aliplaysgtr 2 жыл бұрын
Excellent, thank you !
@abdelaziznassif3845
@abdelaziznassif3845 2 жыл бұрын
Thank you for such great tutuorial
@retiar2111
@retiar2111 6 жыл бұрын
LOVE YOU BRAD! :')))
@yusefkhan1752
@yusefkhan1752 6 жыл бұрын
Excellent video. Liked before watching, and I know I won’t be disappointed.
@GooseGumlizzard
@GooseGumlizzard 5 жыл бұрын
haha same here
@lucasfelipe-ze5sy
@lucasfelipe-ze5sy 3 жыл бұрын
Brad, you're the best!
@supplyuniquenotessun4562
@supplyuniquenotessun4562 3 жыл бұрын
many thanks for you , awesome tut :)
@_rachid
@_rachid 3 жыл бұрын
Thank you Mr Brad.
@nazarpasha
@nazarpasha Жыл бұрын
It was outstanding thanks!
@rajgohil8610
@rajgohil8610 2 жыл бұрын
Thanks...helped me to learn
@frayz38lyve
@frayz38lyve 6 жыл бұрын
I look forward to seeing tutorials on advanced JS features.
@isaacquarshie2563
@isaacquarshie2563 6 жыл бұрын
Traversy Media, You are the Best
@mohammadakbar32
@mohammadakbar32 6 жыл бұрын
thanks brad
@vishnuumakanthan9583
@vishnuumakanthan9583 4 жыл бұрын
Absolutely lovely video
@johanncorcuff9173
@johanncorcuff9173 5 жыл бұрын
Amazing Brad !!!
@carlosdelgado5632
@carlosdelgado5632 4 жыл бұрын
Hello thank you for all your videos are amazing would be good to see integration test videos as well
@sriramsoumya
@sriramsoumya 3 жыл бұрын
great course. include mock functions also in this
Google Chrome Developer Tools Crash Course
51:20
Traversy Media
Рет қаралды 670 М.
Test-Driven Development // Fun TDD Introduction with JavaScript
12:55
Help Herobrine Escape From Spike
00:28
Garri Creative
Рет қаралды 56 МЛН
I Trapped Myself in a Box with Colored Smoke!
00:50
A4
Рет қаралды 17 МЛН
What Happens If You Trap Smoke In a Ball?
00:58
A4
Рет қаралды 16 МЛН
Introduction To Testing In JavaScript With Jest
13:57
Web Dev Simplified
Рет қаралды 480 М.
Are You Too Dumb To Code? A Chat About Imposter Syndrome
7:08
Traversy Media
Рет қаралды 60 М.
10 Udemy Courses Every Developer SHOULD Own (NOT just coding)
19:53
Travis Media
Рет қаралды 845 М.
Mocking Asynchronous Functions with Jest
21:50
Swashbuckling with Code
Рет қаралды 64 М.
Testing In React Tutorial - Jest and React Testing Library
21:28
Async JS Crash Course - Callbacks, Promises, Async Await
24:31
Traversy Media
Рет қаралды 1,4 МЛН
Mock vs Spy in Testing with Jest: Which is Better?
25:12
Dev tips by MoHo
Рет қаралды 7 М.
JavaScript Testing Basics with Jest
54:03
Swashbuckling with Code
Рет қаралды 26 М.
JavaScript for the Haters
2:50
Fireship
Рет қаралды 1,3 МЛН
Postman Api Testing Tutorial for beginners
16:45
Codemify
Рет қаралды 9 М.
Я Создал Новый Айфон!
0:59
FLV
Рет қаралды 1,1 МЛН
Phone charger explosion
0:43
_vector_
Рет қаралды 13 МЛН