1
0

Improved testing flow

This commit is contained in:
2026-03-25 18:59:47 +01:00
parent 0566d9db10
commit dfe13b093d
9 changed files with 85 additions and 29 deletions

29
test.sh
View File

@@ -1,6 +1,33 @@
#!/bin/bash
set -euo pipefail
# Parse flags
HEADED=""
GREP=""
EXTRA_ARGS=()
while [[ $# -gt 0 ]]; do
case "$1" in
--headed)
HEADED="--headed"
export SLOW_MO=1000
shift
;;
--test)
GREP="--grep"
shift
;;
*)
if [[ "$GREP" == "--grep" ]]; then
GREP="--grep $1"
shift
else
EXTRA_ARGS+=("$1")
shift
fi
;;
esac
done
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
CACHED_ASSETS="$SCRIPT_DIR/tests/cached_assets"
@@ -67,4 +94,4 @@ if [ ! -d "node_modules" ]; then
npx playwright install --with-deps
fi
npm test
npx playwright test $HEADED $GREP "${EXTRA_ARGS[@]}"