This project is a Component Testing example using JavaScript, React and Cypress.
- NodeJS
- Cypress
- ReactJs
- node >= ^16.x - Node installation
- npm >= ^8.x - NPM installation (or yarn)
Install the dependencies:
npm installRun application:
npm run startRun tests in headless mode:
npm run test:headlessRun tests with Cypress GUI:
npm run testAfter running the component tests using cypress, you are able to run the tests coverage: (you need to configure the index.html path in your package.json file)
For Windows:
npm run code:coverageFor MacOS
npm run code:coverage:macdocker-compose builddocker-compose up -d && docker ps && docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' app && docker logs appecho 'Cypress gonna run!!' && docker ps && docker exec app ls && docker exec app npm run test:headlessecho 'Eslint gonna run!!' && docker exec app npx eslint src/*.js -f json -o ./report/eslint-report.jsondocker-compose stopFeel free to complement/report something in pull requests. The project is ours! 🤝