Good introduction to React Testing Library. Very clearly explained. I do have a few remarks though: 1. It wouldn't hurt to explain that we are using Jest as our testing environment and that the functions "test" and "expect" for example are Jest functions. 2. It is recommended to call queries like getBy... etc., on the screen method imported from the testing library rather than on the return value of render. This is recommended by the official docs. 3. It is recommended to use userEvent rather than fireEvent to trigger, well, user events. 4. It would help to explain the "Arrange" - "Act" - "Assert" testing methodology. 5. Regarding getByTestId - As already mentioned in another comment, it is recommended in the official docs to only use it if there is no other way, and there usually are alternatives.
@EverAfterBreak23 жыл бұрын
Commeting so the algo helps this guy to get more viewers he deserves it.
@pranav8543 жыл бұрын
Please keep posting more testing-related content. This is incredible and there isn't much testing-related videos out there!
@codingwithdidem3 жыл бұрын
Hello, this video deserves much more attention guys!
@shubhamranjan45963 жыл бұрын
Yes baby
@leelakrishnaisukapalli84313 жыл бұрын
Yeah! You are right
@antnam4406 Жыл бұрын
Share
@joshferriday89663 жыл бұрын
Dude this is an awesome video! I've been trying to wrap my head around this all day and your video was the best introduction I found :)
@romimaximus3 жыл бұрын
yes, this is awesome, 👍, because all the videos that i found about testing, its somone adding some numbers, that has nothing to do with testing ,
@AlgorithmDoctor3 жыл бұрын
This is the best React test crash course on KZbin. Keep up the good job.
@rohitv39553 жыл бұрын
Your video deserves a lot more views! Damn, never been this hooked (no pun intended) on a long programming video.
@nosmoking5863 жыл бұрын
I have many paid course that teach Unit Test on React. But this is by far the best tutorial that I have ever watched.
@raulmartinezjr77083 жыл бұрын
The best React Testing crash course :) Keep it up!
@nardove2 жыл бұрын
Thank you very much for the tutorial, easy to follow and engaging. The only comment I have is that I got a few eslint warnings, I did manage to fix them all after I finish the video but it did confused me a bit, so explaining that possible scenario could happen at the beginning would be great
@calebolojo52463 жыл бұрын
This is by far the best video on TDD. Great job!
@haruwiki3 жыл бұрын
thank you for the video! by far the best RTL tutorial imo. Can you also make a video showing testing with async actions?
@laithacademy3 жыл бұрын
Yeh sometime in the future!
@kunaljain02123 жыл бұрын
I have seen your GraphQL course, React with Typescript course, Docker Course and now this!!! Can't thank you enough for such informative videos man!
@sreeananthakannan3 жыл бұрын
One of the best videos to understand react unit test.......
@asim-gandu-phenchod2 жыл бұрын
Bravo. I have seen a lot of your tutorials and they are compact and well explained. Thank you so much
@franklinmoon25793 жыл бұрын
You're so good! I've been hunting for a teacher who doesn't just 'do the code' but explains the why. 10/10 Keep it up
@CoreyGumbs3 жыл бұрын
Best tutorial ive seen so far on tdd. Thank you for explaining everything
@hendridgonzalez17653 жыл бұрын
Awesome course!!!! Recomended 100%
@veremox3 жыл бұрын
very nice, man! I struggled a bit with this lib until I realized it's logic is something like cascading css lol. helped a lot! thanks
@kazeemkazeem32042 жыл бұрын
This is pure gold. Thanks for this..
@2271masoud3 жыл бұрын
thanks for sharing your knowledge. 1:09:40 can be written in a simpler form : className={ counterValue >= 100 ? 'green' : counterValue
@havefun5519 Жыл бұрын
Thanks for the tut of TDD.
@mayankchauhan66803 жыл бұрын
Brother, before your video I was kind of afraid of TDD but now I am in love with it. I really liked this way of development. Thanks Bro
@jamoliddinz3 жыл бұрын
this is really good. finished in one sit and learnt a lot. thank you
@mugiwaranoDave3 жыл бұрын
Thanks. Been looking for a good TDD crash course in React for some time now
@vikas289783 жыл бұрын
Great video. Explanation are done with appropriate details
@nrbrtbns2 жыл бұрын
Thanks for that video! Very helpful to a React testing newbie like me. Regarding the test for the title color (red/green): Isn't there an option to check the "real" color of the title instead of checking the class name? To me, the class name is an implementation detail. It is not guaranteed that a class name "green" will be mapped to a green title.
@ssaarahj3 жыл бұрын
Best hour and a half of my life! This video deserves so much more attention.
@deepwebtube3 жыл бұрын
Yes, great stuff!! Impressed with your simple and lucid examples.
@MinhazRaufoon15673 жыл бұрын
This deserves more views
@pottaz3 жыл бұрын
Great tutorial. Especially for someone starting out with the React ecosystem. Can you make a video using React Typescript with context API, HOC and testing? Think that will tick a lot of viewers' boxes. That will basically be the full package. The way you describe everything is very clear and straight forward. Keep up the great work!!!
@tealle4672 жыл бұрын
fireEvent (42:00) didn't work properly, after some research i found the solution, i imported waitFor and had to write this to make it work waitFor(() => expect(inputEl.value).toBe("5"));
@2CPT1MP3 жыл бұрын
That's some really high quality content
@sharewithamar3 жыл бұрын
Thanks for the video. A series or course on complete react testing unit, end to end, integration will be helpful for learners.
@OSCAR-CH3 жыл бұрын
Hey bro, awesome video! Very interesting and quickly to understand. Hope you make more videos about testing. Thanksss
@123thebruno3 жыл бұрын
The first time I tried to understand TDD my brain cried, now things are clearer. try to make more videos on the subject, KZbin content is lacking about unit tests in web components. this video helped me a lot, thanks.
@claudio5132 жыл бұрын
Hi, I'm kina new to the TDD and i m trying to follow along. Not a blocking problem but i was wondering if there was an addon or something is missing in my configuration because when i geto to (26:60) component.G intellisense doesnt recognize all the available query. thanks in advance for you re time
@NihilismEnjoyer983 жыл бұрын
Thanks for the effort you've put in. Hope this video gets the attention it deserves :)
@yogajourney95193 жыл бұрын
Every single time I need to know something, Laith Harb has an amazing and recent crash course covering exactly what I'm trying to learn.
@aadil42363 жыл бұрын
Best react-testing tutorial. Would appreciate tutorial on testing async functions in react...
@SyamKumarVoleti3 жыл бұрын
Thank you for the wonderful crash course. Subscribed :)
@chandramouli393 жыл бұрын
Superb video. Very clear and concise explanation.
@uguremirmustafaoglu402 жыл бұрын
Is it a good idea to hold all the buttons and input elements etc. in the global scope to keep code dry?
@randomcell7083 жыл бұрын
Great explanation Laith. I know everyone has their own way of doing things, but you really explained the concepts well
@siva10333 жыл бұрын
can I check if my functional component returns Null. if yes how do I do it. I tried but found nothing.
@egzonberisha99063 жыл бұрын
This is the best video for introduction to testing
@yaaibaadi3 жыл бұрын
Thanks for this video, it really helped me, may you be blessed with peace and happiness
@QuGhZx3 жыл бұрын
Thank you! I've noticed that the `instanceof Window` check fails when running `npm run test` when compared to running in the browser. It seems like the test script is passing a window object that is not an instance of the Window interface. This has forced me into the inconvenience of updating my type checks and doing unnecessary type casting.
@rezabozorgi3113 жыл бұрын
thank you. In some cases we need state and props to be here in our tests. for that cases which way should we supposed to pass?
@cliffordowusuamponsah95323 жыл бұрын
Can you please make the source code available? @Laith Harb
@zaquielrodriguezarce25002 жыл бұрын
Awesome video, so useful! thank you so much for this content. 10/10 explanation
@Zeuchon3 жыл бұрын
The logic at approx 1:10 about the className could be solved without use of Template Strings like this: className={ counterValue >= 100 ? "green" : counterValue
@viveksharma-tt5nj3 жыл бұрын
thank you for explaining RTL in such a simple way, really appreciate you efforts.
@programmertik20463 жыл бұрын
Man why is he Underrarted !!!Awesome teaching bro !!!Loved it !Though i came here from Net NInja .
@tonypeirson62823 жыл бұрын
Excellent content. Subscribed 👍
@floppy_keyboard3 жыл бұрын
The lack of consistency on using double quotes, single quotes, semi colons, and no semi colons is driving me crazy. It's a good tutorial though, thank you!
@manjunathdevendran15163 жыл бұрын
So far its intersting. Question: if your functional component does not import React component, test fails with Reference Error. Why does a functional component need React import though it's not used ?
@thesanju953 жыл бұрын
Hi, really helpful. What font are you using in the terminal and VScode?
@swistek002 жыл бұрын
just for a correct react code const addToCounter = () => { setCounterValue((prev) => prev + inputValue); }; const subtractFromCounter = () => { setCounterValue((prev) => prev - inputValue); };
@diegazo55562 жыл бұрын
This WAS very informative.Like and suscribed.
@benyamin46342 жыл бұрын
thanks . but what is the different between this crash course and your ninja test crash course?
@sinanyaman20073 жыл бұрын
This is some quality content :)
@MrWildmore3 жыл бұрын
thanks, you put a lot of effort here, totally useful for me, great work!
@gian51383 жыл бұрын
Instead of parseInt you can just do +e.target.value to convert it to number
@mohamadilhamramadhan63543 жыл бұрын
This is so awesome dude, thanks!
@adityabhadange16312 жыл бұрын
Thanks alot. This is wonderfully explained! 👍🏻
@mahendranath25043 жыл бұрын
Thank you so much, I liked your channel, immediately subscribed, notified, and like, excellent channel to learn
@BonBonInoc3 жыл бұрын
is this an example of Integration Tests? I'm really confuse with the terms
@gmmkeshav Жыл бұрын
why we are not using jest
@codingpaddy93083 жыл бұрын
Excellent video, thank you!
@꿀꿀-j6y3 жыл бұрын
Thanks for this video! It helped me a lot
@arcan7623 жыл бұрын
What is with the "__test__" directory? Why not "tests" or just have it in the same directory as the component it is for?
@pottaz3 жыл бұрын
Think it is less likely for you to reference those test files if it is using "__" in front of the test folder. Also when looking at the folders you can easily differentiate what is part of the component and what is part of the tests for the component.
@damanvir_saini3 жыл бұрын
Thank you for this video. It is very informative. It really help me to understand the concepts.
@hardikganatra24533 жыл бұрын
Mann , This was so so amazing , you earned a sub definitely , Thanks
@orubenlopes3 жыл бұрын
The is some very high quality crash course. Thank you very much for sharing knowledge with the community!
@MyRc162 жыл бұрын
Learning so much from you bro, thank you so much, second course i complete from your list n.n
@ahadalichowdhury244232 жыл бұрын
Please make testing video like backend node express and mongo
@ahmedtohamy32583 жыл бұрын
Great course !
@reikoleci43032 жыл бұрын
best video around
@KennyCarter903 жыл бұрын
Good video, thank you!
@IkraamDev3 жыл бұрын
When you build the React project with create-react-app, are the data-testid’s removed?
@laithacademy3 жыл бұрын
No, it doesn't, there is a way to do it, but it can get messy
@lsagar3 жыл бұрын
@@laithacademy so do you ship the code to production with data-testid ?? Is it a good practice??
@vinodailawadi14753 жыл бұрын
Hi. I have doubt.Are you using jest library?
@LPeraltaV3 жыл бұрын
Hi, thanks for this video, so much value in here! I would like to ask how can I test a component that receives props/is connected, I just keep in getting that the app should be wrapped in a provider which it already is, so I don't know how to simulate that behavior. Thanks in advance.
@emirsalihovic66163 жыл бұрын
Well done!
@TylerpFarris3 жыл бұрын
Such a concise tutorial, thank you!
@filippetkovski99573 жыл бұрын
Can you please make a video of testing next.js. Thank you
@panicogalactico73793 жыл бұрын
That was really good!! thanks!!
@anakgoa06553 жыл бұрын
thank you for this tutorial bro.. it's really help me, and I hope in the furute you will make another this Test tutorial like using Jest
@polebk1933 жыл бұрын
good stuff!
@rabinarayansahoo86953 жыл бұрын
Superbly explained....
@MrR0gerrabbit3 жыл бұрын
This was an amazing, highly efficient crash course. Thank you so much!
@chilly21713 жыл бұрын
except multiple bad practises.
@amiturfnd3 жыл бұрын
Really helpful, thanks lots bro :)
@abhishekvenu3 жыл бұрын
Hey, This is the best video, Can you please add async call using fetch or axios, Redux, Middleware and testing static images or logos
@codekat1533 жыл бұрын
Great video! However, there is a faint ringing in the background that made it hard to listen and I ended up actually using subtitles instead of listening for the second half of the video.
@thulioguirellehorta13823 жыл бұрын
This is the best approach I had about testing, you convinced me to follow the TTD way of coding because it's pretty fun. Congratulations!!!
@nanonkay56693 жыл бұрын
28:50 don't tell me I was the only one that caught this moment right here lmao, I see you
@szymonpopielarz77013 жыл бұрын
test for react with redux app maybe for next tutorial?
@dayumnson97693 жыл бұрын
Will there also be testing for the nuxtjs app or should one just try to follow and mimic the steps mentioned here in react for nuxtjs?
@laithacademy3 жыл бұрын
No, I'll make one for Nuxt as well. Sorry for the delays. These videos take a very long time to make and couple that with a full-time job, I can only realistically pump out one a week.
@dayumnson97693 жыл бұрын
no worries, was just slightly confused why there is a react testing video after the nuxtjs course. REALLY happy that you will cover testing for the nuxt app! (So I will stop looking around in youtube and wait for your video) Thanks for your efforts!!