The test command evaluates a condition. If the condition evaluates true, the test command returns a "0" exit status, otherwise a "1" exit status is returned.
# To test if a specified variable is equal to the given string:
test $MY_VAR == '/bin/zsh'
# To test if the specified variable is empty:
test -z $GIT_BRANCH
# To test if the specified file exists:
test -e <filename>
# To test if a directory does not exist:
test ! -d <path/to/directory>
# An if-else test statement:
test <condition> && echo "true" || echo "false"