Testing
How versions, docs HTML, and unit tests stay in sync.
Version numbers
Root package.json is the source of truth (MAJOR.MINOR.PATCH, for example 0.5.0).
- Every real commit (pre-commit hook in
.githooks/pre-commit) increments PATCH and syncshelper/package.json+web/package.json. - Major / minor stay put unless you edit them by hand for a milestone.
- Helper
/healthand snapshotproduct.versionread the root version viahelper/src/version.js.
Enable hooks once after clone:
pwsh -File scripts/setup-git-hooks.ps1
Or:
npm run hooks
Markup → HTML
Do not hand-edit docs/*.html or README.html. Edit markdown, then:
npm run docs:html
Open rendered pages in the system browser:
npm run docs:view
CI fails if generated HTML is stale (git diff --exit-code after docs:html).
Unit tests
Vitest covers pure helper logic (Bowl parsers, hours integration, wallet lines, alerts, log timestamps).
npm test
Watch mode:
npm run test:watch --prefix helper
CI
.github/workflows/ci.yml on main / dev:
npm ci(root, helper, web)npm testnpm run build --prefix web- Regenerate docs HTML and assert no drift