Add framework test suite: 144 tests across all core modules + CI#7
Open
douglasjordan2 wants to merge 15 commits into
Open
Add framework test suite: 144 tests across all core modules + CI#7douglasjordan2 wants to merge 15 commits into
douglasjordan2 wants to merge 15 commits into
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a bun:test suite for the entire
hzml/core (~1,600 lines), built task-by-task from a reviewed spec (Sonnet 5 review → Opus 4.8 meta-review → final verification pass). Zero new dependencies.Coverage — 144 tests / 257 assertions across 19 files, ~160ms
Pure units
match.test.ts— route table building, last-segment precedence (static file > dynamic file > static dir index > dynamic dir index), multi-segment params, outermost-first layout accumulationrender.test.ts— multi-root flattening (Multi-root templates join nested arrays with commas (missing flatten in html() wrappers) #5 regression), attribute/child escaping, SafeHtml passthrough, boolean attrs, void tags, depth-1 vsflat(Infinity)component-children asymmetrystate.test.ts— query cache hit/miss/invalidation, toggle registry semantics, deferred registrydeferred.test.ts—Symbol.forbrandinghtmz.test.ts—mergeHeadsingleton-wins rules, tag marking,htmzHead/htmzTailshellplugin.test.ts— sequential setup,setDbpropagation, extend/inject overridedev.test.ts— SSE manager fan-out and dead-client cleanup, error overlay escapingRouter integration
router.parse.test.ts— block extraction; notes route-level<loader>is inert (component-only)router.template.test.ts— template compilation, helper-shadowing protection, ctx-path regression for Multi-root templates join nested arrays with commas (missing flatten in html() wrappers) #5's second call siterouter.components.test.ts— component loading,class→cls, loader string/object/db behaviors, cache lifecyclerouter.script.test.ts— GET/POST selection, params/body, all six import transform forms viafile://fixtures, route-context cachingHTTP handler (no ports — the handler is called as a plain function; fixtures live in mkdtemp sandboxes)
<head>, partials, redirects (302 + meta-refresh), deferred streaming (swap templates + ndjson endpoint), toggle inputs/CSS, fill→slot channels,.toggle-manifestcontainment, error overlaysInfra
db.test.ts(:memory:SQLite),"test": "bun test hzml"script, GitHub Actions workflow running the suite on PRs and pushes to mainNotes
Response.redirectaccepts relative URLs; dynamicimport()in compiled route scripts resolves relative torouter.ts's directory)tsc --noEmiterrors)🤖 Generated with Claude Code