How to test React Components?

In a new React project, I recommend using react-testing-library.

Keep in mind that Enzyme is still fine. What I like in react-testing-library are small API and easy setup. Unfortunately, I had a problem with testing onSubmit handler in the form. It wasn't that hard to fix.

Fortunately for you, I've published How to test onSubmit in react-testing-library.

If you want an introduction to react-testing-library, I can recommend tutorial in create-react-app docs

I've finished reading: #

What I'm reading: #

  1. Feeling Good: The New Mood Therapy by David D. Burns. Thanks to it I've noticed that I have a couple of unhealthy automatic thoughts. The book was even proven to help with depression without therapy. That's a good sell for me.
  2. If you struggle with depression, consider installing: Quirk app on your phone.

Quirk is a crossplatform, GPL-licensed, Cognitive Behavioral Therapy (CBT) app built in React Native / Expo.

I prefer to write on paper. But, I use the help screen to remind myself about cognitive distortions.

  1. Caching up on blogs and podcasts. I will probably start a new book. I want to take time reading "Feeling Good". I haven't decided yet.

Btw. I'm thinking about publishing a page with my recommendations for podcasts/blogs or books. Are you interested in any of them? Let me know!


Until next week,
Krzysztof Kula

Share on Hacker News
Share on LinkedIn


← Home


Want to learn more?

Sign up to get a digest of my articles and interesting links via email every month.

* indicates required

Please select all the ways you would like to hear from Krzysztof Kula:

You can unsubscribe at any time by clicking the link in the footer of my emails.

I use Mailchimp as a marketing platform. By clicking below to subscribe, you acknowledge that your information will be transferred to Mailchimp for processing. Learn more about Mailchimp's privacy practices here.