I recently developed an open source tool called MockIt that allows developers to mock endpoints. The interface with built with React and was tested with react-testing-library rather than my default testing library of choice Enzyme.

I have been using React and Enzyme together for years and I have have had some great experience using it to test React applications. More recently I have seen react-testing-library (developed by Kent C. Dodds) get more coverage and traction which intrigued me.

As part of MockIt I wanted to explore react-testing-library and understand the differences between it and Enzyme.

In this blog post, I will share with you my thoughts moving from Enzyme onto react-testing-library, what I experienced and why I would recommend react-testing-library going forwards.

Hopefully, this post can help you understand some key differences between the two libraries and inspire you to explore them for yourself.

So grab a drink, let’s get started 👍.