HS: logAll config (+1 test)

Add `_hs-config-log-all` runtime flag + captured log list. When set
via `hs-set-log-all!`, `hs-activate!` pushes "hyperscript:init" onto
`_hs-log-captured` and mirrors to console.log. Covers cluster 30.

Generator side: eval-only path now detects the logAll body pattern
(`_hyperscript.config.logAll = true`) and emits a deftest that:

  - resets captured list
  - toggles log-all on
  - builds a div with `_="on click add .foo"` and `hs-boot-subtree!`s
  - asserts `(some string-contains? "hyperscript:")` over captured logs.

hs-upstream-core/bootstrap: 19/26 -> 20/26. Smoke 0-195: 164 -> 165.
This commit is contained in:
2026-04-24 10:05:49 +00:00
parent eb587bb3d0
commit 64bcefffdc
6 changed files with 240 additions and 153 deletions

View File

@@ -1413,7 +1413,17 @@
(deftest "hyperscript:before:init can cancel initialization"
(error "SKIP (untranslated): hyperscript:before:init can cancel initialization"))
(deftest "logAll config logs events to console"
(error "SKIP (untranslated): logAll config logs events to console"))
(hs-cleanup!)
(hs-clear-log-captured!)
(hs-set-log-all! true)
(let ((wa (dom-create-element "div")))
(dom-set-inner-html wa "<div _=\"on click add .foo\"></div>")
(hs-boot-subtree! wa))
(hs-set-log-all! false)
(assert= (some (fn (l) (string-contains? l "hyperscript:"))
(hs-get-log-captured))
true)
)
(deftest "on a single div"
(hs-cleanup!)
(let ((_el-div (dom-create-element "div")))