Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Why is ReactDOM used? #4028
After creating an application the App test file contains a unit test and it uses ReactDOM to test that the component is not crashing. Wouldn't it be better to use the React test renderer or Enyme with the mount command? From https://reactjs.org/docs/react-dom.html I understand that ReactDOM should be used for functionality rather than testing.
Test renderer and/or shallow rendering would probably be a better idea in any cases. But we wanted to show the simplest setup possible. One problem with the test renderer is that as soon as you add something that depends on DOM (e.g. Bootstrap or similar), your tests start to fail. Now you have to explain how to mock things out, test components separately, etc. Our users are often beginners and this is a huge topic. So we went with a bare minimum that would work.