GX Framework
Testing
GX test helpers keep rendering and generated output easy to assert from Go tests. Use them for HTML snapshots, normalized VNodes, compiled source, and mounted behavior.
Helpers
gxtest.Render | Render and fail the test on render errors. |
|---|---|
gxtest.VNode | Inspect the normalized render tree. |
gxtest.RequireProp[T] | Read a typed VNode prop. |
gxtest.CompileGX | Compile source in tests. |
gxtest.MountWASM | Run browser-backed mount assertions. |
Example
html := gxtest.Render(t, Notice(NoticeProps{
Title: "Ready",
}))
Use this with Generated Go when you want to compare snapshots or compiled roots.