0xDeCA10B/demo/client/test.sh

27 строки
532 B
Bash
Executable File

#!/bin/bash
# Enable job control with -m so that the blockchain can be killed.
set -emx
pushd ..
yarn blockchain & bc_pid=$!
sleep 1s
popd
cleanup() {
kill -9 -${bc_pid}
if [ "$1" == "exit" ]; then
exit 1
fi
}
# The `set -e` at the top doesn't seem to help with getting these exit on failure.
truffle compile || cleanup exit
CI=true truffle migrate || cleanup exit
CI=true truffle test || cleanup exit
cleanup
# Set `CI=true` to avoid watching for changes.
CI=true react-scripts test --env=jsdom || exit 1