To ensure assets are compiled when tests run:
RAILS_ENV=test bundle exec rails assets:precompile
Then you can run the full test suite with:
bundle exec rspec
When running specs in parallel for the first time you will first need to set up your test databases.
bundle exec rails parallel:setup
To run the specs in parallel:
bundle exec rails parallel:spec
To drop the test databases:
bundle exec rails parallel:drop
You can see the full list of commands with: bundle exec rails -T | grep parallel
You can run the JS specs with:
yarn run test
Rspec tests can also be tagged with feature_{name}: true
. This will turn that feature on just for the duration of that test.
It's best to lint just your app directories and not those belonging to the framework:
bundle exec rails lint:ruby
or
docker compose exec web /bin/sh -c "bundle exec rails lint:ruby"
To fix Rubocop issues:
bundle exec rubocop -a app config db lib spec --format clang
To lint the JavaScript files:
yarn standard
To fix JavaScript lint issues:
yarn run standard --fix
To lint the SCSS files:
yarn scss:lint
bundle exec rake