this.gui has three test suites. Two run automatically on every build; one requires a compiled dist.
npm run test:runtime
Runs markdown-document-core + monad-discovery-core in sequence. This is also the prebuild hook — it runs before every npm run build.
markdown-document-core.test.tsWhat it tests: The markdown → GUI node pipeline.
Parses a markdown document with headings, paragraphs, inline code, links, fenced code blocks, bullet lists, and tables — and asserts the output tree matches the expected GUI node structure. Also tests resolveMarkdownUrl for relative and absolute URL resolution.
How to run:
npx tsx tests/markdown-document-core.test.ts
Expected output:
markdown-document-core ok
monad-discovery-core.test.tsWhat it tests: The monad discovery and topology scan system.
normalizeMonadEndpointInput — cleans and normalizes endpoint stringsmergeDiscoveredMonads — deduplicates monads by id, merges endpoints and capabilitiesscanMonadTopology — full network scan with a fake fetch: surface probing, mesh discovery, netget registry, dead endpoint detectioncreateMonadDiscoveryStore — reactive store with rescan, race condition handling between slow and fast surface resolversHow to run:
npx tsx tests/monad-discovery-core.test.ts
Expected output:
monad-discovery-core ok
consume-test.mjsWhat it tests: That the compiled dist bundle exports correctly and can be consumed as a package.
Theme, atoms, version are present in dist/this.gui.es.jsthis.gui from local dist in a temp directory and imports it — without react-router-domreact-router-dom present and validates QRouter is importable from this.gui/routerRequires: A compiled dist — run npm run build first.
How to run:
npm run build
node tests/consume-test.mjs
Expected output:
✓ Test 1: Core bundle exports
✓ Test 2: Consumption without react-router-dom
✓ Test 3: Consumption of router subpath
| Suite | Covers |
|---|---|
markdown-document-core |
Markdown parser, node tree output, URL resolution |
monad-discovery-core |
Endpoint normalization, topology scan, merge logic, reactive store |
consume-test |
Bundle integrity, package consumption, subpath exports |