Skip to content

Instantly share code, notes, and snippets.

@darthdeus
Created March 9, 2014 10:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save darthdeus/ed4ab1a65af8eae543c7 to your computer and use it in GitHub Desktop.
Save darthdeus/ed4ab1a65af8eae543c7 to your computer and use it in GitHub Desktop.
#!/bin/bash
echo "Starting web server"
asdf 1>&2 2> /dev/null &
SERVER=$!
SECONDS=0
echo "Waiting for the server to start up"
while (( SECONDS < 10 )); do
if nc -z localhost 9292 > /dev/null; then
break
fi
sleep 1
done
if ! nc -z localhost 9292 > /dev/null; then
printf >&2 'Failed to start\n'
exit 1
fi
echo "Running tests"
phantomjs runner.js http://localhost:9292/qunit.html
kill -15 $SERVER
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment