Run karma task only in test environment

and fails otherwise, as it needs the defaults defined in test environment
This commit is contained in:
Em-AK
2017-03-29 04:58:37 +02:00
committed by Maikel
parent 78ffdec693
commit c72d17dc83
4 changed files with 32 additions and 3 deletions

View File

@@ -14,4 +14,4 @@ echo "--- Bundling"
bundle install
echo "--- Running tests"
bundle exec rake karma:run
./script/karma run

13
script/karma Executable file
View File

@@ -0,0 +1,13 @@
#!/bin/sh
task="$1"
if [ "$task" = "run" ] || [ "$task" = "start" ]; then
exec bundle exec rake "karma:$task" RAILS_ENV=test
else
echo "Usage:"
echo " $0 run # to run the tests once"
echo " $0 start # to run the tests on every file modification"
exit 1
fi