Testing & validation
Application tests
-
Unit tests — Vitest, co-located as
*.test.ts(today in@enode/core: byte parsing, units, contrast, training math). Plain Node environment.npm run test -
Type-check —
npm run typecheck(tscover the whole monorepo). -
Lint —
npm run lint(ESLint across all workspaces).
Documentation builds
A single reusable script, scripts/build-docs.mjs, builds the docs website,
exposed through npm scripts:
| Command | Builds |
|---|---|
npm run docs:typedoc | TypeDoc only → docs-site/static/typedoc |
npm run docs:storybook | Storybook static only → docs-site/static/storybook |
npm run docs:docusaurus | Docusaurus only → docs-site/build |
npm run docs:build | Everything: TypeDoc + Storybook (into docs-site/static), then Docusaurus |
npm run docs:serve | Serve the built site → http://localhost:4000 |
npm run docs:build is the permanent, repeatable command. It only builds
existing documentation — it never installs packages or re-initialises any tool.
The CI gate
npm run docs:check # lint + typecheck + docs:build
This is the gate CI runs on every pull request (see
.github/workflows/docs-check.yml), alongside npm run test. A broken docs
build fails CI.
CI notes
- Run
npm cionce at the repo root — all documentation tooling lives in the rootdevDependencies, so there is no second install step. docs:buildfails loudly if any sub-build fails.
Tests are run by CI as a separate step (
npm run test); they are intentionally not part ofdocs:check, which stays focused on docs + static checks.