#!/usr/bin/env bash # Runs the shared behaviour suite against one app, with JavaScript on and off. # Usage: scripts/test-app.sh [results.json] set -euo pipefail [ $# -ge 1 ] || { echo "usage: $0 [results.json]" >&2; exit 2; } here=$(cd "$(dirname "$0")/../tests/behaviour" && pwd) results=${2:-} [ -z "$results" ] || results=$(cd "$(dirname "$results")" && pwd)/$(basename "$results") cd "$here" if [ ! -d node_modules/@playwright/test ]; then npm ci --cache "${TMPDIR:-/tmp}/npm-cache" --no-audit --no-fund >/dev/null fi BASE_URL="$1" RESULTS_FILE="$results" exec npx playwright test --project js-on --project js-off