diff --git a/script/test b/script/test index a5abf23..ec1db5d 100755 --- a/script/test +++ b/script/test @@ -9,7 +9,7 @@ bundle echo "---> Running tests" bundle exec rake -./script/test_example_app $@ +BUNDLE_GEMFILE="${1-Gemfile}" ./script/test_example_app bundle exec rake test diff --git a/script/test_example_app b/script/test_example_app index d84cd34..eebbf21 100755 --- a/script/test_example_app +++ b/script/test_example_app @@ -2,27 +2,17 @@ set -e -gemfile="${1-Gemfile}" - -run_example_tests() { - bundle - yarn install - - # test a normal test run - bundle exec rake db:test:prepare - NODE_OPTIONS=--openssl-legacy-provider RAILS_ENV=test bundle exec rake assets:precompile - bundle exec rake cypress:run - - # test that passing options works (by printing help) - if ! bundle exec rake cypress:run CYPRESS_RAILS_CYPRESS_OPTS="-h" | grep -q "Usage: cypress run \[options\]"; then - echo "Failed to pass options to cypress run" - exit 1 - fi -} - - cd example - -echo "---> Running example tests with ${gemfile}" -BUNDLE_GEMFILE=$gemfile run_example_tests - +bundle +yarn install + +# test a normal test run +bundle exec rake db:test:prepare +NODE_OPTIONS=--openssl-legacy-provider RAILS_ENV=test bundle exec rake assets:precompile +bundle exec rake cypress:run + +# test that passing options works (by printing help) +if ! bundle exec rake cypress:run CYPRESS_RAILS_CYPRESS_OPTS="-h" | grep -q "Usage: cypress run \[options\]"; then + echo "Failed to pass options to cypress run" + exit 1 +fi