We need to ensure that each component has test coverage of more than 80 percent.
- Unit Testing: Jest - React testing library
- End-to-End Testing: Cypress
src/
├── tests/
│ ├── components/
│ ├── containers/
│ └── ...
├── App.test.tsx
└── ...
To run unit tests:
yarn test
yarn test:coverage
To run end-to-end tests:
npx cypress open
Use describe and it blocks for structuring tests. Mock API calls using jest.mock or cy.intercept.