Originally appeared on BootrAils.
How to launch tests locally, with coverage
Ruby (unit tests) and Cypress (e2e tests)
bin/rails db:drop db:create db:migrate RAILS_ENV=test rm -rf coverage FUNCTIONAL_COVERAGE_PLEASE=true bin/rails cypress:run UNIT_COVERAGE_PLEASE=true bin/rails test bin/rails coverage:report
The last line will merge unit & e2e reports.
All coverage reports are then available in the coverage/ folder
How to launch tests locally, without coverage
yarn test, coverage is still set up, but will not slow down the test suite.
Rails unit tests
e2e test, with visual editor
e2e test, headless run, without editor…