Testing In React Tutorial - Jest and React Testing Library

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 พ.ย. 2024

ความคิดเห็น • 99

  • @selfbrilliance9341
    @selfbrilliance9341 6 หลายเดือนก่อน +8

    I was thriving for this, all the videos on youtube just presumed that we know testing and made a bunch of tutorials on how to do testing but because of your video I know "what" and "why" is testing. Thank you ❤

  • @lokers_one
    @lokers_one ปีที่แล้ว +48

    These tests can produce false negatives and your test won't catch all possible bugs, as you convert string to number. It's very risky in JS world as we all know. For example `Number(false)` produces `0` too. Therefore you wouldn't catch all the bugs. Instead, you should change your assertion to expect to `.toEqual("0")`.

    • @mayurnagdev5545
      @mayurnagdev5545 9 หลายเดือนก่อน

      Thank you this was really helpful

    • @rowland138
      @rowland138 3 หลายเดือนก่อน

      Jesus Christ you are god of react js

  • @ArpithaIndira
    @ArpithaIndira 3 หลายเดือนก่อน

    It was so confusing for the beginner like me to understand this jest until you run the first test case..after that started understanding it even better..thanks for the work.. continue to grow🙏😊

  • @vandanavishnu1922
    @vandanavishnu1922 2 ปีที่แล้ว +4

    Your Videos are very informative. I was able to answer lot of questions in my interview with just watching your videos( react hooks). Now I am watching this . I am sure it will definitely help me...Thanks a lot..

  • @MehediHassan-pn5uc
    @MehediHassan-pn5uc 2 ปีที่แล้ว +10

    Dude you're a underrated Gem! ❤️

  • @universecode1101
    @universecode1101 2 ปีที่แล้ว +12

    Great topic Pedro, super useful for any developer ✌🏻

  • @filipevalentegomes2383
    @filipevalentegomes2383 2 ปีที่แล้ว +8

    That’s so funny, I was gonna take a course for this today, haven’t done testing in a while. Thanks for the video

    • @SharukhKhan-sd7xg
      @SharukhKhan-sd7xg 2 ปีที่แล้ว

      Which course are you going to buy?

    • @PedroTechnologies
      @PedroTechnologies  2 ปีที่แล้ว +4

      Hahahaha hope this video helps! Im planning on making a crash course on it!

    • @filipevalentegomes2383
      @filipevalentegomes2383 2 ปีที่แล้ว

      @@PedroTechnologies awesome. Keep up the good work.

    • @SharukhKhan-sd7xg
      @SharukhKhan-sd7xg 2 ปีที่แล้ว

      @@PedroTechnologies yes need that one

    • @filipevalentegomes2383
      @filipevalentegomes2383 2 ปีที่แล้ว

      @@PedroTechnologies 13 min10 sec, there is an edit mistake I think. It jumps from on frame to another. Not sure if you know about that

  • @ankitkumarsharma2372
    @ankitkumarsharma2372 2 ปีที่แล้ว +1

    Well, It's on exact time. I am going to start to learn Testing in react

  • @OPlutarch
    @OPlutarch 2 ปีที่แล้ว +44

    Thanks! Can you make more videos about testing? I think that it's a topic that a lot of us we need to improve :)
    Greetings.

    • @PedroTechnologies
      @PedroTechnologies  2 ปีที่แล้ว +7

      For sure!

    • @omarelgnn7344
      @omarelgnn7344 2 ปีที่แล้ว

      @@PedroTechnologies yes this presentation of how to test the component or what should be tested and the component that renders data from API and so on
      Thanks for all

  • @markganser5485
    @markganser5485 2 ปีที่แล้ว +4

    Your videos are awesome! I'd love to see some more advanced testing examples on things such as custom hooks, testing where context is present, async functions, and mocking API responses!

  • @ometman
    @ometman ปีที่แล้ว +1

    Hey Pedro, thanks for making testing basics very simple.

  • @SinaTajik
    @SinaTajik ปีที่แล้ว

    The best tutorial for learning react unit test super simple and straight forward :)

  • @willmann96
    @willmann96 ปีที่แล้ว +1

    thank you for the clear and concise information.

  • @ThColinPereira
    @ThColinPereira 2 ปีที่แล้ว +2

    Great video Pedro! Super helpful

  • @mysoregopinathshantanu8800
    @mysoregopinathshantanu8800 2 ปีที่แล้ว

    This helps a lot. And really need more videos on testing.

  • @chaitanyasawant776
    @chaitanyasawant776 2 ปีที่แล้ว +1

    Great topic. Make more videos on this topic

  • @NikhilPawar151
    @NikhilPawar151 11 หลายเดือนก่อน

    Thank you for valuable content. This video clear my concept about testing in react.

  • @Liubov9876
    @Liubov9876 หลายเดือนก่อน

    Thank you! The most understandable tutorial!

  • @travelglobe8997
    @travelglobe8997 ปีที่แล้ว

    You got a new subscriber. Simple and on point. Good video bro.

  • @psydook
    @psydook 2 ปีที่แล้ว +4

    Hey, thanks for the video! Can you also do one which is like a Coding Interview in React from Begginer to Advanced with something like some typescript concepts included ? I think this will benefit alot of people who are preparing for coding interviews. Thanks again !

  • @tootyrnt5533
    @tootyrnt5533 ปีที่แล้ว +1

    Nice video, would be cool to show how this can be set up with Vite + React.

  • @graycoder9911
    @graycoder9911 11 หลายเดือนก่อน +1

    I only know of two great developers Ben awad and pedrotech

  • @DaltonLaboratories
    @DaltonLaboratories ปีที่แล้ว +1

    I would rather use "test" over "it" in your examples. The second one is an alias and it reads better only when you name your tests like this: 'it("should do something.."), it("should display the counter")' etc. Nevertheless, good tutorial, thanks!

  • @karis7539
    @karis7539 2 ปีที่แล้ว

    i personally love testing because i love automating things with Selenium or Playwright

  • @rodrigocastro3934
    @rodrigocastro3934 ปีที่แล้ว

    Great video Pedro. It would be nice to have the 'advanced' version where testing state changes by clicking buttons ;))

  • @ggwellplayed4568
    @ggwellplayed4568 2 ปีที่แล้ว +2

    Continue sharing your knowledge. God will take care fo you. Thanks dude ;)

  • @parvathyvd
    @parvathyvd 2 ปีที่แล้ว

    Thanks a lot Pedro :) Another useful video. You keep helping us.

  • @dineshyeshamoni5426
    @dineshyeshamoni5426 26 วันที่ผ่านมา

    Nice informative video on jest.

  • @christianlewis7055
    @christianlewis7055 ปีที่แล้ว

    Weird feedback: that habit of repeatedly highlighting the test while you're busy talking is satisfying only as long as you repeatedly highly exactly the correct area. Like if you start highlighting a string, as long as you start at the opening double quote and finish exactly after the closing quote, I find it satisfying and might actually help to retain my interest. But if you don't hit the mark just right, it will bother me. 😄

  • @bartlebob
    @bartlebob หลายเดือนก่อน +1

    Having to add metadata to the dom elements sucks.

  • @neverexecute2467
    @neverexecute2467 2 ปีที่แล้ว

    This video is awesome and helps a lot, I also need create a dynamic XML sitemap and HTML sitemap in React

  • @LeslieDuan
    @LeslieDuan 2 ปีที่แล้ว

    thank you so much, hope to see tutorial about cypress

  • @turing4991
    @turing4991 2 ปีที่แล้ว

    You should try to make a video on publishing a react component. Publishing a hook is easy.

  • @GlennMartin
    @GlennMartin 2 ปีที่แล้ว

    Pedro my man, how about testing forms and components that fetch data.
    Would like to learn how to mock them.

  • @bananablu47
    @bananablu47 2 ปีที่แล้ว +1

    Hey what is const { getByTestId } around 9:00 at line 6 ? An anonymous const?

  • @mohitdhule9654
    @mohitdhule9654 2 ปีที่แล้ว +1

    Thank you 🙏

  • @antidotejack2771
    @antidotejack2771 3 หลายเดือนก่อน

    this is great, Thanks

  • @kranthikumar5215
    @kranthikumar5215 ปีที่แล้ว

    Love you pedro❤

  • @JaredFL
    @JaredFL 2 ปีที่แล้ว

    I'd like to see a Webpack beginner video :)

  • @amanjat7
    @amanjat7 7 หลายเดือนก่อน

    Helpful

  • @waleedsharif618
    @waleedsharif618 2 ปีที่แล้ว +1

    Could you show jest --coverage And how to get 100% test coverage ?

  • @salonipande6190
    @salonipande6190 2 ปีที่แล้ว

    @Pedro Tech can you please share the playlist of this course

  • @tsdineshjai8565
    @tsdineshjai8565 2 ปีที่แล้ว +1

    Hey Pedro 👋, if possible do a crash course on this topic

  • @brilliantatosam
    @brilliantatosam 2 ปีที่แล้ว

    Awesome content

  • @sodhigurpreetsingh
    @sodhigurpreetsingh 2 ปีที่แล้ว

    Great video again pedro.. can you make a video on Formik or any other library you know is best for forms..

  • @santhoshkashyap9405
    @santhoshkashyap9405 3 หลายเดือนก่อน

    Thank you ;)

  • @rockncdesign
    @rockncdesign 2 ปีที่แล้ว

    Thanks your video!!!

  • @harishg9429
    @harishg9429 2 ปีที่แล้ว +1

    Can you pls make a video on testing components mocking API , also testing state. Thanks

    • @PedroTechnologies
      @PedroTechnologies  2 ปีที่แล้ว +2

      I can fs make one! Testing states is not that good imo, i would rather just spy on the state function and test its functionality bc states dont update equally. Also, testing should be for testing how the UI changes, not how the internal logic acts :)

    • @harishg9429
      @harishg9429 2 ปีที่แล้ว

      @@PedroTechnologies Thank you Pedro, I like all your videos, they are easy to follow and highly educational.

  • @azizkhujakhujaev2598
    @azizkhujakhujaev2598 2 ปีที่แล้ว

    Nice video and can you please make a video about React Native testing library and in advance thanks!

  • @drawingdr9829
    @drawingdr9829 2 ปีที่แล้ว

    hello bro thanx for your videos we are really benefit from them. you deployed react node mysql app in heroku but it very expansive . can you do a tutorial about deploy it in digital ocean? thank you

  • @Popo-hr6gc
    @Popo-hr6gc ปีที่แล้ว

    What VSCode theme are u using?

  • @xman3666
    @xman3666 ปีที่แล้ว

    If i have a componente such a “loading” using lazy render react. How can I test the elements that come after the loading? 😢

  • @shishirrai1069
    @shishirrai1069 2 ปีที่แล้ว

    Please make video on jest and enzyme

  • @cometarioxD
    @cometarioxD 2 ปีที่แล้ว

    Watch out folks, if you're getting the error message, look for EVERY syntax error possible!

  • @Silent_Squid-p3f
    @Silent_Squid-p3f 11 หลายเดือนก่อน

    how can this be done with ts and vite

  • @ankitchauhan8682
    @ankitchauhan8682 ปีที่แล้ว

    How is he using jsx with. Js extension?

  • @karthikbalaji383
    @karthikbalaji383 2 ปีที่แล้ว

    I have never done testing before so can anyone tell me how percentage of the testing concepts are covered in this video.

  • @internetexplorer7880
    @internetexplorer7880 2 ปีที่แล้ว

    What vscode theme is this?

  • @the_terrific_m
    @the_terrific_m 25 วันที่ผ่านมา

    But where is the github repo link?

  • @robertvelasquez8641
    @robertvelasquez8641 ปีที่แล้ว

    what if i use vite?

  • @suvendukumarsahoo4172
    @suvendukumarsahoo4172 2 ปีที่แล้ว

    He can u have idea testing for post api

  • @primy3576
    @primy3576 2 ปีที่แล้ว

    vs code theme?

  • @patrykK1028
    @patrykK1028 ปีที่แล้ว

    There's no link to the code :/

  • @gmmkeshav
    @gmmkeshav ปีที่แล้ว

    code of this video?

  • @WydeZ
    @WydeZ ปีที่แล้ว

    where is the code

  • @ranza658
    @ranza658 2 ปีที่แล้ว

    Is source code available for this video?

  • @bradenmitchell3265
    @bradenmitchell3265 2 ปีที่แล้ว +1

    Deja vu @ 13:09?

    • @PedroTechnologies
      @PedroTechnologies  2 ปีที่แล้ว

      Thank you for letting me know! This was a mistake on the editing!

  • @arihantjain8347
    @arihantjain8347 ปีที่แล้ว

    It wasn't in round figure, stuck at 999, so I made it 1K.

  • @reactDevelopment
    @reactDevelopment ปีที่แล้ว

    can you make avideo on these
    act()
    mockComponent()
    isElement()
    isElementOfType()
    isDOMComponent()
    isCompositeComponent()
    isCompositeComponentWithType()
    findAllInRenderedTree()
    scryRenderedDOMComponentsWithClass()
    findRenderedDOMComponentWithClass()
    scryRenderedDOMComponentsWithTag()
    findRenderedDOMComponentWithTag()
    scryRenderedComponentsWithType()
    findRenderedComponentWithType()
    renderIntoDocument()
    Simulate

  • @demarbrown439
    @demarbrown439 ปีที่แล้ว

    13:00

  • @thevasupodcast4561
    @thevasupodcast4561 2 ปีที่แล้ว +1

    Hey i noticed that here you are using a derived state, which is not best practice. You should move the state to a higher level component.

  • @johnddonnet5151
    @johnddonnet5151 6 หลายเดือนก่อน

    Who uses js in 2023???

    • @PedroTechnologies
      @PedroTechnologies  6 หลายเดือนก่อน +2

      I make videos in js bc it is more easily understandable by a wider audience. Someone who knows ts, understands js. Whilst someone who knows js doesn't necessarily know ts. If the point of the video is not the ts syntax, I prefer to use javascript since more people can understand it :)

    • @JohnWickXD
      @JohnWickXD 6 หลายเดือนก่อน

      *I think you meant 2024

  • @Den1sNovikov
    @Den1sNovikov 9 หลายเดือนก่อน

    How I suppose to do it with you, if u are not sharing starting demo code?))) Dislike.

  • @Human_Evolution-
    @Human_Evolution- 2 ปีที่แล้ว

    I cannot reproduce this on my app at all. I hate this video. I hate testing. I watch you all the time and love your channel but testing has me so bitter I am downvoting you.

  • @LS9690
    @LS9690 ปีที่แล้ว

    Awesome video. It has helped me a lot already. There is an issue for later versions. Just add screen.getByTestId instead of getByTestId and you are good to go. For getByRole as well.