Shared vanilla-test suite
| Area | Evidence |
|---|---|
| Exports | Root default, root named, and legacy Message.js resolve to one class. |
| State | Fresh defaults, enumerability, instance isolation, and recovery. |
| Serialization | Exact two-key JSON, toJSON(), extras exclusion, and native failure semantics. |
| Loading | JSON strings, object input, nested values, malformed JSON, and invalid shapes. |
| Browser global | String/object loading, errors, and JSON parity with the ES module. |
The protocol module records 12 focused checks. Separate documentation and local-server suites treat pages, metadata, local links, package exports, security boundaries, workflows, and the generated header as tested repository contracts.
Local commands
npm ci
npm test
npm run coverage:node
npm run coverage:chrome
npm startDevelopment and coverage use Node.js 22.12 or newer because vanilla-test v2 targets current Web-standard runtimes. The shipped js-message module retains its existing Node.js 13.2 engine floor and has a dependency-free compatibility smoke.
Coverage and delivery gates
- Node and Chrome independently require 100% statements, branches, functions, and lines across the shipped modules.
- Linux, macOS, and Windows run the package suite on current Node releases.
- Legacy-compatible Node versions execute the dependency-free package smoke.
npm packis inspected and installed in a clean temporary project before delivery.- GitHub Pages receives an explicit allowlist only after required test jobs pass.
The root package import, both supported deep paths, and the browser-global file are verified directly—no generated build stands between the tests and npm files.