Unit Testing Your React App



Code Samples

Abstract, Description, & Notes (from Papercall)


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. Enzyme, a library for testing your React components directly, enables you to write simple tests 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!