aboutsummaryrefslogtreecommitdiff
path: root/dev/test.sh
blob: f552153524b33a81fa877276b43f594530446c12 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env bash
# Runs all headless browser suites. Starts the dev server on :8080 if it isn't running.
set -u
cd "$(dirname "$0")/.."
OUT="${1:-${TMPDIR:-/tmp}}"
if ! curl -s -o /dev/null http://localhost:8080/; then
  node serve.js 8080 >/dev/null 2>&1 &
  SERVER=$!
  trap 'kill $SERVER' EXIT
  sleep 1
fi
status=0
for suite in functional tools ui features; do
  echo "=== $suite"
  node "dev/$suite.js" "$OUT" 2>&1 | grep -v willReadFrequently || status=1
  [ "${PIPESTATUS[0]}" -eq 0 ] || status=1
done
exit $status