#!/usr/bin/env bash

# Switch to the working directory from wherever this is being invoked
pushd .
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd "$DIR" || exit

# Run the front-end tests
if ! ./front-end.sh; then
    ERRORED=true
fi

# Run the API tests
if ! ./api.sh; then
    ERRORED=true
fi

# If any tests failed, have this script return that failure
if [ "$ERRORED" == true ]; then
    echo "Some tests failed"
    exit 1
fi

# Switch back to the directory this was invoked from
popd || exit

#!/usr/bin/env bash


# Run the front-end tests
if ! ./front-end.sh; then
    ERRORED=true
fi

# Run the API tests
if ! ./api.sh; then
    ERRORED=true
fi

# If any tests failed, have this script return that failure
if [ "$ERRORED" == true ]; then
    echo "Some tests failed"
    exit 1
fi

--- 
+++ 
@@ -1,9 +1,5 @@
 #!/usr/bin/env bash
 
-# Switch to the working directory from wherever this is being invoked
-pushd .
-DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
-cd "$DIR" || exit
 
 # Run the front-end tests
 if ! ./front-end.sh; then
@@ -20,6 +16,3 @@
     echo "Some tests failed"
     exit 1
 fi
-
-# Switch back to the directory this was invoked from
-popd || exit
Handle directory context for test runner

Toward #114.
