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
1 changed files with 5 additions and 3 deletions

View File

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