test: add P1 manual configuration walkthrough
This commit is contained in:
Executable
+20
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)"
|
||||
if [[ $# -ne 1 || ! "$1" =~ ^(prepare|serve|stop|cleanup)$ ]]; then
|
||||
printf 'usage: %s prepare|serve|stop|cleanup
|
||||
' "$0" >&2
|
||||
exit 2
|
||||
fi
|
||||
if [[ "$1" == prepare ]]; then
|
||||
for command in node npm git curl unzip zipinfo lsof; do
|
||||
command -v "$command" >/dev/null || { printf 'missing prerequisite: %s
|
||||
' "$command" >&2; exit 127; }
|
||||
done
|
||||
for path in scripts/p1-acceptance.sh scripts/test-p1-acceptance.sh backend/scripts/p1-acceptance.mjs; do
|
||||
[[ -f "$repo_root/$path" ]] || { printf 'Task 8 prerequisite missing: %s
|
||||
' "$path" >&2; exit 1; }
|
||||
done
|
||||
npm --prefix "$repo_root/backend" run build
|
||||
fi
|
||||
exec node "$repo_root/backend/scripts/p1-manual-acceptance.mjs" "$1"
|
||||
Executable
+5
@@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)"
|
||||
npm --prefix "$repo_root/backend" run build
|
||||
node --test "$repo_root/backend/scripts/p1-manual-acceptance.test.mjs" "$repo_root/backend/scripts/p1-render-snapshot.test.mjs"
|
||||
Reference in New Issue
Block a user