Some simple code / demo about how to to test in React with
jest
+enzyme
+eslint
.
- E2E test: 10%
- Integration test: 20%
- Unit test: 70%
- test01 ~ test04: jest, test logical module.
- test05: jest + enzyme, test react component with assert.
- test06: jest, test react component with snapshots.
- test07: jest + jsdom, test react component, and mock the document function in
setupFiles
.
git clone [email protected]:hustcc/react-testing-demo.git
cd react-testing-demo
npm i
npm test