How to test React components with Mocha, Chai & Enzyme

1 · Robin Wieruch · July 21, 2019, 11:56 a.m.
Recommended alternative: Instead of Mocha/Chai, using Jest as test runner and assertion library for unit, integration and snapshot tests. Before setting up the test setup with different testing libraries and writing the React component tests, you will need a simple React application which can be tested in the first place. You will introduce a simple App component which can be tested in the following sections....