Skip to content

Commit 6446e50

Browse files
committed
Add single-command test run script and update documentation
1 parent fa7d172 commit 6446e50

4 files changed

Lines changed: 34 additions & 1 deletion

File tree

AGENTS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ node --test .github/scripts/plus-code.test.mjs
3939
node --test .github/scripts/data-json.test.mjs
4040
```
4141

42+
Need to run the tests end-to-end? `./scripts/run-tests.sh` executes the helper, intake, and plus-code suites, builds the Astro site via `npm --prefix pcd-website run build`, and then runs `data-json.test.mjs` in sequence. Run this script from the repo root after installing dependencies so you get the full battery of checks in one shot.
43+
4244
No install needed — `open-location-code` is already available at `pcd-website/node_modules/`.
4345

4446
### Testing protocol

TEST.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,12 @@ These tests cover the shared pure functions extracted into `event-issue-helpers.
7474

7575
---
7676

77+
## Single-command test run
78+
79+
Run `./scripts/run-tests.sh` from the repo root after installing dependencies (`pcd-website` already has `node_modules/` from `npm install`). The script executes the helper, intake, and plus-code suites, then builds the Astro site (`npm run build` inside `pcd-website/`) before running `data-json.test.mjs`. Use this single command whenever you want to verify the full test battery end to end.
80+
81+
---
82+
7783
## Plus Code functions
7884

7985
**File:** `.github/scripts/plus-code.test.mjs`

pcd-website/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"dev": "astro dev",
77
"build": "astro build",
88
"preview": "astro preview",
9-
"astro": "astro"
9+
"astro": "astro",
10+
"test": "../scripts/run-tests.sh"
1011
},
1112
"dependencies": {
1213
"@astrojs/vue": "^5.1.4",

scripts/run-tests.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
# Run from repo root to keep relative paths consistent.
5+
root_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
6+
cd "$root_dir"
7+
8+
tests=(
9+
".github/scripts/event-issue-helpers.test.mjs"
10+
".github/scripts/process-new-event-issue.test.mjs"
11+
".github/scripts/process-edit-event-issue.test.mjs"
12+
".github/scripts/plus-code.test.mjs"
13+
)
14+
15+
for test in "${tests[@]}"; do
16+
printf '\n=== %s ===\n' "$test"
17+
node --test "$test"
18+
done
19+
20+
printf '\n=== Build data.json dependencies ===\n'
21+
npm --prefix "${root_dir}/pcd-website" run build
22+
23+
printf '\n=== .github/scripts/data-json.test.mjs ===\n'
24+
node --test ".github/scripts/data-json.test.mjs"

0 commit comments

Comments
 (0)