Skip to content

Commit 6a447f3

Browse files
committed
Don't call api for testCases having to expect object
1 parent cecfa29 commit 6a447f3

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

api-test.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,17 +180,18 @@ test_factory() {
180180
echo "${BOLD}Testing Case:${RESET} $TEST_CASE"
181181
echo_v "${BOLD}Description: ${RESET}$(jq -r ".testCases.$TEST_CASE.description" $FILE)"
182182
echo_v "${BOLD}Action: ${RESET}$(jq -r ".testCases.$TEST_CASE.method //\"GET\" | ascii_upcase" $FILE) $(jq -r ".testCases.$TEST_CASE.path" $FILE)"
183-
call_api $TEST_CASE
184-
if [[ $API_ERROR == 1 ]]; then
185-
continue
186-
fi
187183
if [[ -z $(jq -r ".testCases.$TEST_CASE.expect? | select(. !=null)" $FILE) ]]; then
188184
tput cuf 2
189185
echo "No test cases found"
190186
echo ""
191187
echo ""
192188
continue
193189
fi
190+
call_api $TEST_CASE
191+
if [[ $API_ERROR == 1 ]]; then
192+
continue
193+
fi
194+
194195
tput cuf 2
195196
echo "${UNDERLINE}a. Checking condition for header${RESET}"
196197
test_runner $TEST_CASE "header" "$RESPONSE_HEADER"

0 commit comments

Comments
 (0)