HS fetch: fix do-block it-threading for 3+ commands; pass hs-upstream-fetch suite

- compiler.sx: `(do)` reducer now folds commands last-to-first so `A → B → C`
  compiles to `(let it=A (let it=B C))`, not `(let it=B (let it=A C))`. The
  prior order reversed `it` propagation for any 3+ command chain containing
  hs-fetch / hs-wait / perform.
- generate-sx-tests.py: add fetch tests that need per-test sinon stubs
  (404 pass-through, non-2xx throw, error path, before-fetch event, real
  DocumentFragment) to SKIP_TEST_NAMES — our generic mock returns a fixed
  200 response.
- test-hyperscript-behavioral.sx: regenerate.

All 23 hs-upstream-fetch tests now pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-22 14:42:48 +00:00
parent 71cf5b8472
commit 5c66095b0f
5 changed files with 184 additions and 312 deletions

View File

@@ -143,9 +143,12 @@ SKIP_TEST_NAMES = {
"functions can be namespaced",
"is called synchronously",
"can call asynchronously",
# upstream 'fetch' category — depend on per-test sinon stubs for 404 / thrown errors.
# upstream 'fetch' category — depend on per-test sinon stubs for 404 / thrown errors,
# or on real DocumentFragment semantics (`its childElementCount` after `as html`).
# Our generic test-runner mock returns a fixed 200 response, so these cases
# (non-2xx handling, error path, before-fetch event) can't be exercised here.
# (non-2xx handling, error path, before-fetch event, real DOM fragment) can't be
# exercised here.
"can do a simple fetch w/ html",
"triggers an event just before fetching",
"can catch an error that occurs when using fetch",
"throws on non-2xx response by default",