On Testing React Components

November 24, 2015

Recently, I tried to figure out unit testing React components. I stumbled upon a couple of good articles by Simon Smith and Marcin Grzywaczewski. The former was mainly about shallow rendering and latter went into great depths to flesh out the numerous ways of approaching unit testing React components. Based on the recommendation of the React developers, I swallowed the shallow rendering pill.

Whatever approach you decide to go with, Enzyme from Airbnb is a promising testing utility that should remedy a lot of the pains associated with querying the virtual dom. Skin-deep is a similar utility written specifically for shallow rendering.

comments powered by Disqus