Test pages headless
Checked against f15b998 on 2026-11-10. The files it covers are unchanged since.
niso-run runs a page exactly as a host would, without a window: the same
DOM, style, layout and render stream, on virtual time. That makes it the
quickest way to test a niso app, and it needs no simulator.
cargo build --release -p niso-quickjs --bin niso-run(cd examples && pnpm install --frozen-lockfile && node build.mjs)target/release/niso-run --dump --tap 60,140 examples/dist/counter.jsWhat you can check
Section titled “What you can check”- The DOM after some taps:
--tap X,Y(repeatable) taps at CSS pixels after a frame, and--dumpprints the document’s HTML at the end. Assert on it withgrepor your test runner. - Layout:
--boxesprints every element’s border box underbodyas JSON, so a test can check where things are. - What a host would draw:
--render FILEwrites every frame’s render stream. - Speed and memory:
--timereports the time to first frame, the mean time per tap frame, the nodes alive after GC and peak memory. - What’s missing:
--missinglists every DOM member and global the page looked up that niso doesn’t have.
Timers run on virtual time, so a page with a five-second timeout finishes in
milliseconds; --max-ms bounds how much page time a run may take. A run
exits 1 on any uncaught exception, which is enough for a smoke test in CI.
Pages with network and storage
Section titled “Pages with network and storage”--serve URL=FILE answers a request with a file’s bytes, so a test that
fetches always sees the same response. --storage DIR keeps localStorage
and IndexedDB between runs, to test what a reload sees.
On V8 or JavaScriptCore
Section titled “On V8 or JavaScriptCore”niso-node takes the same options and runs the page on Node, Deno or Bun
(Headless), which helps tell an engine bug from a
DOM bug.
Every option is in the CLI reference.