By Aditi Chakravarthi on August 29, 2016
As part of the engagement team at Hootsuite, we use React as part of our front-end framework for everything from the streams that users see when they log on to dashboard to the new Assignment Manager. Testing is crucial to ensure that our code will work correctly when it has the right inputs, or will fail gracefully when it doesn’t. One of the many challenges of front-end testing is that with increasingly complex frameworks like React, thorough tests are needed to ensure that components render correctly, receive the right props, and update properly. Such tests are often difficult to implement, maintain, and understand. While React offers a ReactTestUtils library, the library is very basic in terms of ease of testing and manipulating the React component’s output. We went as far as writing our own test utils but it simply did not provide the extensive coverage needed.
Enter Airbnb’s Enzyme!