Test Suite
Repo-side checks for deterministic authoring, schema-backed performance mode, transport adapters, and browser demos.
Fast Checks
# Run the fast static/public docs gate
npx vitest run tests/public-docs-current-authoring.test.js
# Run all repo tests
npm test
The public docs gate fails if the docs make the old hosted dev tree the primary path, omit V0.2/V0.3 performance mode, omit current demo links, or blur authoring APIs with runtime bus/worker infrastructure.
Focused Performance-Mode Tests
tests/performance-mode-world-facade-api.test.js-ctx.world()API shape.tests/performance-mode-engine-backed-sim.test.js- schema-generated engine mode and world input path.tests/performance-mode-render-mirror.test.jsandtests/performance-mode-render-mirror-lifetime.test.js- mirror projection and entity lifetime behavior.tests/performance-mode-pacman-world-facade.test.js- Pac-Man world-facade gameplay parity.tests/performance-mode-pacman-trystero-network.test.js- real engine path for the Trystero browser demo shell.tests/trystero-transport.test.js- Trystero transport conformance over a fake room mesh.
Browser Demo Checks
Use Playwright for the current Pac-Man demos. The world-facade Trystero demo is the release-facing browser path.
# Local server defaults are configured in playwright.config.js
npx playwright test tests/e2e/pacman-trystero-join.spec.js
# Smoke a deployed world-facade demo
EM_V02_LOCAL_BASE=https://libs.letsinspire.com/em-pacman-v02-world-trystero/ npx playwright test tests/e2e/pacman-trystero-join.spec.js
Advanced diagnostic live page: https://libs.letsinspire.com/em-pacman-v03-worker-trystero/. Use worker and time-sliced proof URLs for runtime diagnostics only; they are not the first-path tutorial material.
What These Tests Protect
| Area | Risk |
|---|---|
defineGame | Game modules accidentally gain host, network, or class-constructor assumptions. |
| Schema-backed performance mode | Canonical state leaks class instances or non-structured-clone data. |
ctx.world() | Authoring code bypasses routed input or backend-owned rollback. |
| Render mirror | Renderer becomes authoritative or reads live backend internals. |
| Trystero transport | Browser P2P behavior drifts from the transport interface. |
| V0.3 buses/workers | Runtime infrastructure is mistaken for a separate gameplay API. |