fix(#1392): test-live.js — load packet-helpers.js in makeLiveSandbox, wire into CI (#1393)

## Root cause

`makeLiveSandbox()` in `test-live.js` didn't load
`public/packet-helpers.js`, so `window.getParsedDecoded` /
`getParsedPath` were undefined. The `dbPacketToLive` and
`expandToBufferEntries` suites failed all 8 assertions with
`getParsedDecoded is not a function`. The `expandToBufferEntriesAsync`
suite was unaffected because it builds its sandbox manually and already
loads packet-helpers.js.

## Fix

- `test-live.js`: load `public/packet-helpers.js` in `makeLiveSandbox()`
before `live.js`. Mirrors the working pattern in
`expandToBufferEntriesAsync`.
- `.github/workflows/deploy.yml`: wire `node test-live.js` into the "Run
JS unit tests" step so this can't silently regress again.
- Adjusted one cross-realm `deepStrictEqual([], [])` → `.length === 0`
because the array literal lives inside the vm sandbox; host-side
`deepStrictEqual` rejects the proto mismatch even when the value is
semantically equal. Test-harness only.

No production code change.

## Mutation verification

With the new `loadInCtx(ctx, 'public/packet-helpers.js')` line removed,
all 8 original assertions return (`getParsedDecoded is not a function`).
With the fix in place, `node test-live.js` exits 0 — 95 passed, 0
failed.

## CI wire

`node test-live.js` now runs in deploy.yml under "Run JS unit tests
(packet-filter)" alongside the other root-level test files. YAML
validated with `yaml.safe_load`.

Fixes #1392

Co-authored-by: openclaw-bot <bot@openclaw.dev>
This commit is contained in:
Kpa-clawbot
2026-05-25 23:36:03 -07:00
committed by GitHub
parent f15d2efe81
commit aa63a478a7
2 changed files with 3 additions and 1 deletions
+1
View File
@@ -111,6 +111,7 @@ jobs:
node test-issue-1364-pill-no-clamp.js
node test-issue-1375-scope-stats-fetch.js
node test-issue-1361-cb-presets.js
node test-live.js
- name: 🧹 Frontend lint (eslint no-undef) — issue #1342
run: |