Integration Testing Frameworks for React

Photo by freestocks on Unsplash

Integration Testing Frameworks for React

Integration testing is between UNIT testing and END-2-END testing. It is a critical piece of testing strategy that makes sure your components are usable by other components even if they are still doing their work correctly.

For example, a button that correctly handles onClick events but does not allow other components to set an onClick handler is completely useless.

End 2 end tests can catch integration failures but they are expensive to run. Hence we should always write integration tests before tackling end to end tests.

If you want to learn more about how react integration tests can be written please read this.

Frameworks availability

React relies on frameworks like Jest, Cypress, React-Testing-Library among others for unit as well as integration testing but Cypress and Jest appear to be winners because of their features and wide adoption.

React integration testing has a very good ecosystem of testing frameworks out of which Jest appears to offer the best of all worlds. If I were to pick one of these, I would have picked Jest. [Source]