From a6a8261a735b7cdc9dd172f3dfa28418af57b10c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Orhun=20Parmaks=C4=B1z?= Date: Sat, 21 May 2022 17:52:47 +0300 Subject: [PATCH] refactor(fixtures): merge test steps in a single subshell --- fixtures/test-fixtures.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fixtures/test-fixtures.sh b/fixtures/test-fixtures.sh index f17b3b5..71c40c0 100755 --- a/fixtures/test-fixtures.sh +++ b/fixtures/test-fixtures.sh @@ -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" }