grepfood-demo/server/tests/run-tests.sh

21 lines
505 B
Bash
Raw Normal View History

2024-10-16 14:05:47 +00:00
#!/bin/bash
function test() {
echo "-----------------------------[ TEST ]-----------------------------"
printf "running $1\n\n"
eval "$1"
exit_status=$?
printf "\n\n"
if [ ! $exit_status -eq 0 ]; then
abort "command: $1 failed with: $exit_status"
fi
}
test "curl -i http://localhost:8080/version"
test "curl -i http://localhost:8080/api/ingredients"
test "curl -i http://localhost:8080/api/recipes"
test "curl -i http://localhost:8080/api/recipe/bread/ingredients