Skip to main content

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-checknpm run typecheck (tsc over the whole monorepo).

  • Lintnpm run lint (ESLint across all workspaces).

Documentation builds

A single reusable script, scripts/build-docs.mjs, builds the docs website, exposed through npm scripts:

CommandBuilds
npm run docs:typedocTypeDoc only → docs-site/static/typedoc
npm run docs:storybookStorybook static only → docs-site/static/storybook
npm run docs:docusaurusDocusaurus only → docs-site/build
npm run docs:buildEverything: TypeDoc + Storybook (into docs-site/static), then Docusaurus
npm run docs:serveServe 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 ci once at the repo root — all documentation tooling lives in the root devDependencies, so there is no second install step.
  • docs:build fails loudly if any sub-build fails.

Tests are run by CI as a separate step (npm run test); they are intentionally not part of docs:check, which stays focused on docs + static checks.