This directory holds the theme's automated tests. It is the proof-of-concept
for the testing system tracked in the testing epic.
tests/
├── fixtures/site/ # a minimal Hugo site that uses the theme
├── e2e/ # Playwright specs (E2E, accessibility, no-JS)
├── support/ # build-the-fixture + static-server helpers
├── catalog.yaml # feature -> test manifest for the coverage gate
└── coverage-gate.mjs # fails CI when a param/shortcode has no test
The legacy build/HTML harness still lives atscripts/test-hugo-quickstart.ts and is being migrated into this structure.
# Browser end-to-end, accessibility, and progressive-enhancement (no-JS) tests.
# Builds the fixture site against the local theme working tree, serves it, and
# runs Playwright. Requires browsers: `npx playwright install chromium`.
npm run test:e2e
# Feature -> test coverage gate: fails if an [ananke] param or a shortcode has
# no entry in tests/catalog.yaml.
npm run test:coverage-gate
# Legacy quickstart build/assertion harness.
npm test
tests/support/prepare-site.mjs creates a temporary themes directory with a
symlink to the repository root and runs Hugo against tests/fixtures/site, so
the suite always exercises the current theme code (including uncommitted
changes) without committing an absolute-path symlink. The built site is served
by tests/support/dev-server.mjs, which Playwright launches viawebServer in playwright.config.ts.
When you add or change a feature:
tests/fixtures/site/.tests/e2e/ (interaction, output, or accessibility).tests/catalog.yaml so the coverage gate is satisfied.The coverage gate (npm run test:coverage-gate) fails if a new [ananke]
parameter or shortcode is not listed in the catalog with at least one test, so
tests stay in sync with features.
The axe suite catches roughly 30-40% of WCAG issues. It is a floor, not a
guarantee — pair it with manual keyboard and screen-reader checks.