This session will introduce you to the tools Jest and React Testing Library, and show how you can use them to write meaningful and maintainable unit tests for a React app. You’ll learn what to test and how to test it, from basics to best practices. Attendees will leave empowered to test confidently.
Writing unit tests is like making good food choices. We know it’s beneficial to us, and it’s easy to do when we aren’t stressed. But give us a looming deadline and a product owner looking over our shoulder, and we throw our good habits out the window.
React testing tools can help you maintain good unit testing habits. Setup with Jest as a test-runner and test framework is a breeze. React Testing Library enables you to write simple tests of your React components, with clear intentions. In this session, you’ll learn how to use these tools to write meaningful and maintainable unit tests.
We’ll also talk about guidance and best practices. What should you test? When should you test it? How can you keep your React code friendly to tests?
This session will arm you with the tools and guidance to unit test your React app. You’ll leave ready to write tests!
The talk is approachable for beginners, with each example building on the previous. The bulk of the talk is spent on the features of Jest and React Testing Library. The last section of the talk includes useful guidance for all levels, empowering attendees to start testing their app with confidence.
I have presented this talk at MidwestJS 2017 in Minneapolis, CodeMash 2018 in Ohio, Open Source North 2018 in Minnesota, and That Conference 2018 in Wisconsin. At CodeMash, I received an average rating of 4.9/5.0 from attendees.
Note: All links below reveal speaker information.
Some reactions from Twitter: