Тёмный

React Testing Crash Course 

Traversy Media
Подписаться 2,2 млн
Просмотров 313 тыс.
50% 1

Learn about testing in React including unit, e2e and integration testing with React Testing Library, Jest & Cypress
Techbase RU-vid Channel:
/ @techbasedev
Starter Repo:
github.com/MitchelSt/react-te...
Final Repo:
github.com/MitchelSt/react-te...
Timestamps:
0:00 - Brad Intro
0:55 - Mitchel Intro
1:24 - Why should you test?
1:58 - What to test?
5:48 - Demo app setup
11:06 - Unit tests
25:11 - Integration tests
28:07 - End-to-End tests
55:56 - Wrap up

Наука

Опубликовано:

 

7 июн 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 369   
@ahmedosama7632
@ahmedosama7632 2 года назад
Great! We need more tutorials about testing, there isn't much of it on the internet
@TraversyMedia
@TraversyMedia 2 года назад
I agree. I always found it difficult to try and teach testing because it's hard to do it in a "real world" way. I think Mitchel did an excellent job though
@RogerThat902
@RogerThat902 2 года назад
Agreed. It's arguably the biggest "woah, I have no idea what I should be doing" I found on a new job. And I'd argue it's maybe the one thing that can separate you from other candidates and make you stand out on jobs. If you are good at testing it will make you seem like a boss from day 1. I know that sounds silly but being good at it really is super valuable.
@webwhale
@webwhale 2 года назад
Becoz nobody wants to waste time...
@josephakayesi6951
@josephakayesi6951 2 года назад
You're right. Maybe one day you'll make some for us.
@griffinkirkland9087
@griffinkirkland9087 Год назад
Web whale is it time wasting to test apps?
@tevinmorake8924
@tevinmorake8924 2 года назад
Thanks Brad, Mitchel. I learnt quite a lot today even though I've been testing for years. Really appreciate it guys!
@samanfayazi1226
@samanfayazi1226 2 года назад
What would we do without you brad? honestly I have no clue, respect guys, for all your hard work
@bufootballa
@bufootballa 2 года назад
This video was simply INCREDIBLE! Do yourself a favor and watch from start to finish. You won't regret it and will definitely add some items to your skillset, especially the amazing Cypress automated tests! It was so much simpler than I imagined to get automated E2E tests setup and running! Thanks Brad and Mitchel!
@ansonthedev
@ansonthedev 2 года назад
Perfect video! Testing is very important and I'm glad it's being covered. Thanks Techbase & Brad! :)
@ceciliaalbero7284
@ceciliaalbero7284 2 года назад
this is PURE GOLD. Best video to get into Jest. Thank you Brad and Mitchel
@adrienconversanodbl_g5119
@adrienconversanodbl_g5119 2 года назад
Thank you Traversy ! I enjoy both your project tutorials as well as your UDEMY courses !
@devorein
@devorein 2 года назад
Found another gem. Thank you so much, Brad and Techbase.
@romimaximus
@romimaximus 2 года назад
Awesome !! yeahhh "testing" !! we really needed a tutorial like this !! thankx Brad and Mitchel !! you dont know how much this helped me and many others Devs out there..!! 😊👍
@Abelfubu
@Abelfubu 2 года назад
Perfect timing! I was just looking for a testing library guide with react and then this videos just came out, amazing!
@muhammed_rahif
@muhammed_rahif 2 года назад
Exactly what I needed... perfect timing...🤩
@dennisgonzales9521
@dennisgonzales9521 2 года назад
Same here haha
@hsingh110
@hsingh110 Год назад
A great video on testing, I have been looking for something like this for days and it really covered everything I needed for my current project. The only suggestion I have is being mindful of your IDE placement, as at times I couldnt see the full code, so had to replay several times in certain parts of the video. Thank you for the great content Mitchel and Brad
@mohamedfouedslama3412
@mohamedfouedslama3412 Год назад
That is one awesome tutorial right there ! honestly great job Mitchel and thank you for this detailed how to test. keep up the hard work.
@Hi-373
@Hi-373 2 года назад
really well done, I have waited alot of tutorials and your knowledge and delivery is excellent, keep up the good work
@Bruno87198
@Bruno87198 2 года назад
This is exactly the content that I was looking for! Thank you so much!
@nickschmitt8594
@nickschmitt8594 2 года назад
End-to-end testing with Cypress is amazing, but it'll miss out on the tiny details that unit testing will cover. That's why the whole pyramid is essential. Great video!
@sethwhitaker5567
@sethwhitaker5567 2 года назад
Yeah that's what I'm thinking as well. I am new to testing, but it seems like unit tests help locate precisely where bugs are in your code, integration tests help determine whether the components of your app interact together properly, and end-to-end tests help check whether workflows are behaving as expected in a more realistic user situation. All seem necessary, or at least beneficial.
@scottwears674
@scottwears674 2 года назад
I think these videos are incredible, Brad is known as the father of web tutorials and it's lovely to see people who have probably gain some knowledge from him create videos for the channel and for Brad to alway big up his friends
@dannieh9849
@dannieh9849 2 года назад
Hi! Really useful video. One suggested improvement is that, because of heavy indentation, maybe you could split the editor with a horizontal line instead of vertical? It's really hard to follow when you're scrolling left to right. At almost no point was it possible to read an entire instruction without you doing that. Thanks and keep doing what you're doing!
@ParthChokshi
@ParthChokshi 2 года назад
Great to see testing video. Not a lot of folks cover this much!
@khoushiekram5287
@khoushiekram5287 Год назад
Thanks a bunch Mitchell & Brad for making this awesome video react testing tutorial for us!
@thisaintmyrealname1
@thisaintmyrealname1 2 года назад
YES. Thank you. This is the other half of the knowledge that is required at jobs!
@moseschris9756
@moseschris9756 Год назад
This is really amazing brad, I have learnt a lot from your channel. Keep up the good work sir.
@bartomiejsadecki8309
@bartomiejsadecki8309 2 года назад
Just in time for my end of uni project, incredible, thank you!
@chintansawla
@chintansawla 2 года назад
This is such a good method of teaching how to test a react app. Loved the video!
@makombi32
@makombi32 Год назад
Great tutorial, went from knowing nothing about automatic testing to slowly but surely implementing it in my own projects in just about 60 minutes.
@hercules2170
@hercules2170 2 года назад
This video was super informative...Thanks a bunch Mitchel! :)
@anilloutombam
@anilloutombam 2 года назад
Perfect Timing ❤️ Was just searching damn Brad ❤️❤️
@ahmadjonabdusamadov4282
@ahmadjonabdusamadov4282 2 года назад
that's it what I'm looking for these days:) thank you guys
@mukul98s
@mukul98s 2 года назад
Timing can't be better. I have been looking for this and boom 💥
@BlurryBit
@BlurryBit 2 года назад
Exactly what I was looking for ( i kw there are lots of others on YT, but not as a single video...) :D :D Awesome stuffs man. Will be very helpful. Please keep up the good works. :)
@alexotoous
@alexotoous Год назад
I have watched and taken countless testing courses but no one has ever explained the rationale behind testing better than this. Great Job 4:20/58:35
@FaisalMahmood91
@FaisalMahmood91 2 года назад
Thank you that was great! I was also able to enable typescript in both the unit and e2e testing files which made things a bit more clear having types/suggestions/warnings etc.
@bobkazamakis5169
@bobkazamakis5169 2 года назад
More about testing please! Great job team.
@80Vikram
@80Vikram 2 года назад
thanks a ton to both of you, god bless you both. Code without test cases is like driving without seat belts on, it upto you which one you prefer :)
@FernandoPonteFilho
@FernandoPonteFilho 2 года назад
Fantastic! Thanks for the content, I have your MERN eCommerce and miss a lot on good content covering tests.
@munapadhi8723
@munapadhi8723 2 года назад
Your teaching is always outstanding , we are waiting your new video, thanks for your hard work keep growing 🙏
@eliasmanzano1574
@eliasmanzano1574 2 года назад
I did not see the video was yours and when I listen to the intro music I was like...hell yeah! Muchas Gracias señor Brad
@kidschannel2115
@kidschannel2115 2 года назад
thanks for this course,this is the best and reliable channel to learn new techs, btw plz be noted "yarn install && yarn dev" command is replaced with "yarn add add yarn dev". for them who struggled at this point
@adyarabiat9394
@adyarabiat9394 2 года назад
I miss your speech videos (non tutorial ones). I wish you get better soon Brad 🙏🏼
@jasonpmerrigan
@jasonpmerrigan 2 года назад
Great video, thank you very much. Just one small bit of feedback/improvement, I find its always best to have the full code editor on the screen, not having to scroll left and right. Other than that, everything was great, thank you both.
@avinashmurmu9070
@avinashmurmu9070 2 года назад
these are the tutorials I am looking for ❤️
@eleah2665
@eleah2665 2 года назад
Hello Brad. Always good to see you. Still the king.
@OTadashi162
@OTadashi162 2 года назад
Awesome, this is the best testing tutorial for React i have ever watch
@JohnKomarnicki
@JohnKomarnicki 2 года назад
Always a pleasure to see your promoting other content creators! Testing is not talked about as much, glad to see this covered in this guest video! Great video, Mitchel!
@TechbaseDev
@TechbaseDev 2 года назад
Thanks John! And yes, the fact that Brad gives other content creators these kind of chances says a lot about him as a person 🐐
@JohnKomarnicki
@JohnKomarnicki 2 года назад
@@TechbaseDev He really is the 🐐. I can relate, as i had the opportunity a few months back to create a video for his audience. He helps out others more than i think he knows. Good luck in the future, will definitely stay updated with your channel!
@thatCbean
@thatCbean 2 года назад
First of all, great video, it is very educational and easy to listen to. I would like to say a couple things however: Firstly, you said that integration tests are more than just combining unit tests, but I feel like you didn't really cover the whole idea of what the difference is and why you need both. For those reading this in the future, a unit test tests a single component and is very useful to find problems with specific parts of your program. The purpose of an integration test is to test if the components correctly function when put together. They basically test the connection between components. If you rely solely on integration tests you may find errors, but it will be harder to see in which component they might be whereas unit tests generally point you right to the faulty component. Unit tests are also really useful for boundary testing: Testing cases near branching points in the code, and other edge cases. EDIT: In other words, for important parts of your code you would want both unit and integration tests. In this case I would have used unit tests to see if the buttons work correctly and to see if the text boxes take their inputs correctly, and an integration test to see if clicking the pay button actually correctly registers the inputs of the fields and passes them on to the next component, instead of just combining the unit tests. Secondly, I feel like your code editor is a bit too small, you can't really see the code, even though that should be the focus of the video. EDIT 2: At 42:55 you also say that there is only one text box so just targeting "textbox" is fine. That is of course only the case if no other textbox will be added later. If you only have one test like this it would be easy to edit, but if you write a lot of tests like this adding components to pages can get very tedious very quickly because of the amount of tests you will have to edit, on top of the new tests you already have to write. EDIT 3: At about 45:00 you say "use as small of a value as possible", but I would personally argue that this way, you do not test larger values which are much more important. I would say a better option would be to reset the database before and/or after your tests, and to at least test larger values in your integration tests (especially very large values).
@Advanced21thHuman
@Advanced21thHuman 2 года назад
Exactly what I'm trying to learn at the moment!
@jonatasdeoliveiracoelho4691
@jonatasdeoliveiracoelho4691 2 года назад
Thank you very much, Mitchel! I learnt a lot with your good explanations.
@TechbaseDev
@TechbaseDev 2 года назад
Thanks Jonatas, appreciate it a lot!
@zaqisilverano
@zaqisilverano 2 года назад
Great!! This video really help me understanding testing!
@aronhegedus
@aronhegedus 2 года назад
that helped library seems very OP, thanks for showing
@yaldakarimi3772
@yaldakarimi3772 2 года назад
Love you both, great content on both channels thank you
@TechbaseDev
@TechbaseDev 2 года назад
Thanks so much 🙏
@nothjg
@nothjg 2 года назад
thanks for this I was exactly looking for this
@victoriaadedayo1876
@victoriaadedayo1876 9 месяцев назад
Thank you, I never knew testing could be this fun😁
@dsqaurecoding
@dsqaurecoding 2 года назад
Once again you read my mind, I just need this course 😲
@davidkezi6086
@davidkezi6086 2 года назад
Thanks for this. I loved it ❤️ Learnt a thing or two
@TechbaseDev
@TechbaseDev 2 года назад
Thanks so much David!
@licokr
@licokr 2 года назад
Thank you very much, before watching this video, I was afraid to write test codes, and now I think I would make it well
@frankiefab
@frankiefab 2 года назад
Just came at the right time. Thank you
@ichankabir6936
@ichankabir6936 2 года назад
Thanks man, I was about to start learning react testing and I found your tutorial
@codezero6023
@codezero6023 2 года назад
Wow! That’s cool! Will definitely find a use for Cyprus. I will also look at Selinium too
@ranjanarulanandham3981
@ranjanarulanandham3981 2 года назад
ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-zS3rsUljVTA.html
@slowprogrammer
@slowprogrammer 2 года назад
Desperately needed such a content ❤️❤️☺️
@omarsaulmoralesibarra117
@omarsaulmoralesibarra117 2 года назад
Awesome testing course 🔥🔥
@vaibhavshukla4761
@vaibhavshukla4761 2 года назад
I am praying for you to have your all problems solved and all mighty to give you strength to fight you problems. please be strong!
@user-gw4df2de3k
@user-gw4df2de3k Год назад
Great video! Thank you for your work
@27sosite73
@27sosite73 5 месяцев назад
yep, this is the best video on what to test on the internet, ty guys
@27sosite73
@27sosite73 5 месяцев назад
extremely thankfully for this video
@Ts-yy2jn
@Ts-yy2jn 2 года назад
Perfect! ❤️ More React stuff 😍
@Middollo
@Middollo 2 года назад
Thank you for this amazing video!
@huseynfy
@huseynfy Год назад
Thank you so much for this great video!
@king-manu2758
@king-manu2758 2 года назад
When you did the cypress bit with testing playground I think testing finally clicked for me.
@anaelennaemeka4078
@anaelennaemeka4078 Год назад
Fantastic, now I have a basic understanding of React testing.
@HoneyLemonNuin
@HoneyLemonNuin Год назад
Thank you so much. This is very helpful. I have learn a lot from this video.
@techniker8745
@techniker8745 Год назад
Great vid, learnt a lot
@gomesdev
@gomesdev 2 года назад
Thanks for the video, we helpful me so much!
@phsaurav
@phsaurav 2 года назад
Thank you. Great! direct on point type video on testing in react.
@shivani9840
@shivani9840 2 года назад
Hey Saurav! Have you ever taken the help of any tutorial to do a project? Would you be interested exploring opportunities in web development?
@ExplorationAT
@ExplorationAT 2 года назад
nice instructor, the project is absolutely enormous for a 1hr tutorial, was overkill for my CPU
@aryansingh2105
@aryansingh2105 2 года назад
I learned about the Test Playground tool which is super useful. I loved E2E testing using cypress. I think unit testing part could be improved by including different ways to get and different assertions along with a small example of mocking. Mitchel is very nice instructor. He explained things very nicely. On all as always great video loved it.👌🙌
@shivani9840
@shivani9840 2 года назад
Hey Aryan! Are you a fresher and open to opportunities in web development currently? Have you created any projects in JavaScript frameworks?
@1TaylorUK
@1TaylorUK 2 года назад
Really helpful video as always. For future reference, I really struggle to follow along and understand the code because it was half the width of the screen.
@moiserwibutso4899
@moiserwibutso4899 2 года назад
Thanks a lot for this amazing tutorial.
@GewoonWijnand
@GewoonWijnand 2 года назад
Great video man! Thanks
@TechbaseDev
@TechbaseDev 2 года назад
Thanks bro!
@user-gu8np4
@user-gu8np4 2 года назад
Thanks! It is a great overview
@ScienceSeekho
@ScienceSeekho Год назад
Great!
@priyangpatel8135
@priyangpatel8135 2 года назад
Thanks a lot man we need testing tutorials
@erwin7427
@erwin7427 2 года назад
More of these, please!!
@rakesh.rankawat
@rakesh.rankawat 2 года назад
This is why I like Brad more because he focus on doing more instead of just showing stuffs.
@miladsakhaei
@miladsakhaei Год назад
Thank you so much! really helpful!
@moonyyy9093
@moonyyy9093 2 года назад
A very good video! Hopefully, we can have more React testing videos. One more question, if I have a button driving user to another route, like from “/“ to “/user”, should it be covered on End-to-End testing?
@TechbaseDev
@TechbaseDev 2 года назад
Thanks a lot! It highly depends on what you want to test. Let's imagine I want to render a profile page (where users can check and update their profile data) when navigating to "/user" by clicking on a button on the home page. In that case I will probably write a test that does three things: 1) navigate user from the home page to the "/user" page (by clicking on the button), 2) check if the correct data is in there and 3) update the profile data (to then check if it has been updated correctly).
@alqam2011
@alqam2011 Год назад
Thank you so much, informative!
@Human_Evolution-
@Human_Evolution- 2 года назад
Using hotkeys to clear the test output is nice for testing. If you have a macro keyboard, you can make a clear button, it's super handy! CLEAR TERMINAL: press Ctrl + Shift + P key together
@josephinegeoghegan2913
@josephinegeoghegan2913 Год назад
This looks so cool, I really want to do it. I'm having a lot of issues with the setup, because some of it is deprecated.
@michajaron6236
@michajaron6236 2 года назад
Doing my first testing tomorrow right in time😄
@jamesarnold22
@jamesarnold22 2 года назад
I'm struggling to find elements in the DOM when using React & Styled Components - did you have a work around for this? Fantastic well structured tutorial, thanks.
@WaterJay
@WaterJay Год назад
extremely informative, thanks mate
@huuthongle8768
@huuthongle8768 Год назад
were you able to sign in?
@tomfeller7833
@tomfeller7833 2 года назад
Thank you very much for this awesome video
@sensational3771
@sensational3771 2 года назад
thank you my favorite coder , nice
@dvvinodkumar6672
@dvvinodkumar6672 Год назад
it's really a interesting video and very helpful and very easy way of testing especially for a beginner.
@aadil4236
@aadil4236 2 года назад
Hey brad how are you doing? Thanks, for this great tutorial. I would love a tutorial series about the implementation of the front-end with React and typescript. It's so confusing. I can make sense of the types in typescript alone, but when it comes to React with typescript (with all the ReactNodeElemeents and stuff it doesn't make sense. A recommendation to some course on youtube or book will do as well, but I prefer to learn from you it's easy and concise) Sorry for this long ass comment.
@rockNbrain
@rockNbrain 2 года назад
Great job! Tks
@vali558
@vali558 Год назад
perfect tutorial, right to the point.
@luisdwq123
@luisdwq123 2 года назад
Great tutorial!! I have a suggestion though, the editor font size could be smaller, the way it is now its hard to read the code in its entirety because its too zoom in :)
@promwaseem
@promwaseem Год назад
Finally completed this in 7 days, daily chunk by chunk. 🎯
@michaelask9018
@michaelask9018 2 года назад
Good content - I would recommend making the application screen smaller so we could actually read all of the code - but again, very nice presentation
@littlebonanzaz
@littlebonanzaz 2 года назад
You are the greatest this was needed
Далее
React Router v6 Major Changes
13:12
Просмотров 129 тыс.
5 Pro-Level React Do's & Don'ts
30:06
Просмотров 173 тыс.
Why Vitest Is Better Than Jest
13:13
Просмотров 127 тыс.
The Importance of Specialization in Coding
7:13
Просмотров 163 тыс.
Stop Writing So Many Tests
10:02
Просмотров 80 тыс.
Introduction to Jest Testing | JavaScript Unit Tests
25:30
Express Crash Course (2024 Revamp)
1:46:11
Просмотров 40 тыс.
Странный чехол из Technodeus ⚡️
0:44
СТОИТ ЛИ БРАТЬ IPHONE 13 В 2024?
13:53
Просмотров 29 тыс.
Technics 1500 Ремонтируем
52:13
Просмотров 25 тыс.