Skip to content

Commit d9576ce

Browse files
committed
ci(site): portable test glob (Node 20 lacks ** ); bump runner to Node 22
The Pages workflow pinned Node 20 but used a quoted 'site/test/**/*.test.mjs'. Node's own ** glob needs Node 21+, so Node 20 treated it literally and failed with 'Could not find', blocking the deploy job. Use a shell-expanded glob (site/test/*.test.mjs — all test files are flat in site/test/) and run on Node 22. Claude-Session: https://claude.ai/code/session_01CDQ9ccpnsu3YtiVkvPqZtr
1 parent 4fa2ae9 commit d9576ce

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

.github/workflows/pages.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@ jobs:
1919
steps:
2020
- uses: actions/checkout@v4
2121
- uses: actions/setup-node@v4
22-
with: { node-version: '20' }
23-
- run: node --test 'site/test/**/*.test.mjs'
22+
with: { node-version: '22' }
23+
# Shell-expanded glob (not quoted): portable across Node versions. Node's
24+
# own `**` glob needs Node 21+, so a quoted 'site/test/**/*.test.mjs' fails
25+
# on older runners with "Could not find". All test files are flat in site/test/.
26+
- run: node --test site/test/*.test.mjs
2427
deploy:
2528
needs: test
2629
if: github.ref == 'refs/heads/main'

docs/superpowers/plans/2026-07-21-config-wizard.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
## Global Constraints
1212

1313
- **Zero runtime/test dependencies.** No npm install; tests use only `node --test` and Node built-ins (`node:fs`, `node:test`, `node:assert`, global `crypto`/`btoa`). Node ≥ 20 assumed in CI.
14-
- **Canonical full-suite command:** `node --test 'site/test/**/*.test.mjs'` (Node's own glob). Do NOT use a bare-directory arg like `node --test site/test/` — it is not portable (fails with `MODULE_NOT_FOUND` on Node 22). Single-file runs like `node --test site/test/rules.test.mjs` are fine.
14+
- **Canonical full-suite command:** `node --test site/test/*.test.mjs` (shell-expanded glob — the shell lists the files, so it is portable across Node versions). Do NOT use a bare-directory arg (`node --test site/test/` fails with `MODULE_NOT_FOUND` on Node 22) and do NOT quote a `**` glob (`'site/test/**/*.test.mjs'` relies on Node's own glob, which needs Node 21+ and fails on the Node-20 CI runner with "Could not find"). Single-file runs like `node --test site/test/rules.test.mjs` are fine.
1515
- **ES modules everywhere.** Every `site/*.js` and `site/lib/*.mjs` uses `export`/`import` so the same file loads in the browser (`<script type="module">`) and under Node. Browser-loaded modules use the `.js` extension; Node-only test/lib helpers use `.mjs`.
1616
- **Client-side only.** No secret, password, or form value is ever sent over the network. No analytics, no external script/CDN.
1717
- **Generated YAML must compile as-is.** Always emit empty `text_sensor:` and `binary_sensor:` sections (the components fail to compile without them — CLAUDE.md rule). Apply block order exactly: `esphome → esp32 → psram → esp32_hosted → wifi → captive_portal → logger → api → ota → uart → tigo_monitor → tigo_server → sensor → text_sensor → binary_sensor → (display overlay)`.

0 commit comments

Comments
 (0)