DEV Community

Discussion on: What are your thoughts on testing and TDD?

Collapse
 
marinafroes profile image
Marina Costa

Hi, João. I'm a code newbie and I'm still on that frustrating stage, trying to understand and implement tests in React. The concept of testing and TDD is great, but right now I don't know exactly how to get started. Do you have any recommendation for me?
For instance, do you use react-testing-library? Do you recommend a good resource for learning it (or other testing libraries)? Any hint will be really appreciated. :D

Collapse
 
imforja profile image
João Forja 💭

Hi Marina :)

When dealing with React applications, I tend to use Cypress, cypress-testing-library, react-testing-library, and Jest.

While knowing how to use test-related tools is a good thing, after you've learned the basics (running tests, assertions, and mocks), learning more about the tools probably won't do much to alleviate your testing/TDD frustrations, as most of them come from a lack of understanding of the goals and processes of testing/Test-driving an application.

Do you have a specific example of something that you would like to test but don't know how? I think I can give more accurate and useful hints if we go over a specific example that's causing you frustration, rather than talking about what I think is important in general when testing an application :)

Collapse
 
marinafroes profile image
Marina Costa

Hey João, thanks for replying.
I think you are right, I'll first learn the basics of testing before diving deeper in the tools. That's where the frustration comes from, for sure.
No specific examples right now, but you answer already helped me. And I'll keep following your other articles on this subject. Thanks!

Thread Thread
 
imforja profile image
João Forja 💭

Glad I could help. Feel free to reach out if you have any particular question you think I could answer :)