Skip to content

Commit fa1f2ee

Browse files
committed
Simplify test scripts
1 parent d0d4a91 commit fa1f2ee

File tree

2 files changed

+14
-24
lines changed

2 files changed

+14
-24
lines changed

script/test

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ bundle
99

1010
echo "---> Running tests"
1111
bundle exec rake
12-
./script/test_example_app $@
12+
BUNDLE_GEMFILE="${1-Gemfile}" ./script/test_example_app
1313

1414
bundle exec rake test
1515

script/test_example_app

+13-23
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,17 @@
22

33
set -e
44

5-
gemfile="${1-Gemfile}"
6-
7-
run_example_tests() {
8-
bundle
9-
yarn install
10-
11-
# test a normal test run
12-
bundle exec rake db:test:prepare
13-
NODE_OPTIONS=--openssl-legacy-provider RAILS_ENV=test bundle exec rake assets:precompile
14-
bundle exec rake cypress:run
15-
16-
# test that passing options works (by printing help)
17-
if ! bundle exec rake cypress:run CYPRESS_RAILS_CYPRESS_OPTS="-h" | grep -q "Usage: cypress run \[options\]"; then
18-
echo "Failed to pass options to cypress run"
19-
exit 1
20-
fi
21-
}
22-
23-
245
cd example
25-
26-
echo "---> Running example tests with ${gemfile}"
27-
BUNDLE_GEMFILE=$gemfile run_example_tests
28-
6+
bundle
7+
yarn install
8+
9+
# test a normal test run
10+
bundle exec rake db:test:prepare
11+
NODE_OPTIONS=--openssl-legacy-provider RAILS_ENV=test bundle exec rake assets:precompile
12+
bundle exec rake cypress:run
13+
14+
# test that passing options works (by printing help)
15+
if ! bundle exec rake cypress:run CYPRESS_RAILS_CYPRESS_OPTS="-h" | grep -q "Usage: cypress run \[options\]"; then
16+
echo "Failed to pass options to cypress run"
17+
exit 1
18+
fi

0 commit comments

Comments
 (0)