refactor(fixtures): merge test steps in a single subshell

This commit is contained in:
Orhun Parmaksız 2022-05-21 17:52:47 +03:00
parent 00167db3d6
commit a6a8261a73
No known key found for this signature in database
GPG key ID: F83424824B3E4B90

View file

@ -13,10 +13,12 @@ run_fixture() {
SERVER_PID=$! SERVER_PID=$!
trap 'kill -9 "$SERVER_PID" && wait "$SERVER_PID" 2> /dev/null' RETURN trap 'kill -9 "$SERVER_PID" && wait "$SERVER_PID" 2> /dev/null' RETURN
sleep 1 sleep 1
( set -e; setup ) ( set -e;
( set -e; run_test ) setup
run_test
teardown
)
result=$? result=$?
( set -e; teardown )
return "$result" return "$result"
} }