Debian Codegraph @

Platforms/emscripten/browser_test/run_test.sh

raw
1 #!/bin/bash
2 set -euo pipefail
3 cd "$(dirname "$0")"
4 rm -f test_log.txt
5 echo "Installing node packages" | tee -a test_log.txt
6 npm ci >> test_log.txt 2>&1
7 echo "Installing playwright browsers" | tee -a test_log.txt
8 npx playwright install 2>> test_log.txt
9 # Disable color so FORCE_COLOR=1 (set in CI) doesn't wrap the port number in
10 # ANSI escape codes, which would produce an invalid baseURL in Playwright.
11 export PORT=$(FORCE_COLOR=0 npx get-port-cli)
12 echo "Running tests with webserver on port $PORT" | tee -a test_log.txt
13 CI=1 npx playwright test | tee -a test_log.txt