Skip to content
This repository was archived by the owner on Oct 26, 2026. It is now read-only.

Temme tests

Oussama Essamadi edited this page Oct 25, 2026 · 3 revisions

Testing

Temme is tested at several levels. All of them run in CI, on Node.js 24 and 26.

Command Suite
pnpm test Unit and integration tests with Vitest and happy-dom, with coverage
pnpm test:smoke Smoke tests against the built dist/ (run pnpm build first)
pnpm test:e2e End-to-end tests in Chromium with Playwright
pnpm test:mutation Mutation tests with Stryker
pnpm check Everything, the way CI runs it

Unit and integration tests

  • tests/unit/ holds one test file per source module.
  • tests/integration/ exercises the public API: rendering, inheritance, validation, references, and one regression test per fixed bug.

pnpm test fails below 100% statement, branch, function or line coverage. The HTML report is written to coverage/.

Smoke tests

tests/smoke/ checks what gets published:

  • every format (ESM, CommonJS, browser ESM, UMD as a global, CommonJS and AMD module, IIFE) loads in plain Node.js and works
  • the type declarations type-check for ESM and CommonJS consumers
  • tree-shaking: an unused import bundles to nothing, and validate alone leaves the rendering code out
  • the files pnpm pack would publish

End-to-end tests

tests/e2e/ serves the repository with a small static server and drives Chromium through:

  • the documentation website (pnpm build:site first): it's fully rendered by Temme, with highlighted snippets and no errors
  • examples/index.html
  • the script tag builds, cross-frame targets and outer element references

The first run needs the browser: pnpm exec playwright install chromium.

Mutation tests

Stryker mutates the source and checks that the tests catch every change. The run fails below a 95% mutation score; the suite currently scores 100%. The report is written to reports/mutation/index.html.

Clone this wiki locally