@page-engine/page-testkit
v0.5.1
Published
Test helpers for compiling and driving PageEngine pages in tests.
Readme
@page-engine/page-testkit
Test helpers for the PageEngine declarative front-end engine.
Assertion helpers for the result shapes returned by @page-engine/page-compiler
and @page-engine/page-runtime-core, so tests can compile Page Sources
against inventories and assert on diagnostics without file adapters or the
CLI.
- Depends only on public APIs from
@page-engine/page-contracts,@page-engine/page-compiler, and@page-engine/page-runtime-core. - Deterministic: the same helpers the monorepo's own test suites use.
Install
npm install --save-dev @page-engine/page-testkitRequires Node >= 22.12. ESM only.
Minimal example
import {
assertCanonical, assertDiagnostic, assertExecutionPlanFailed, assertResolutionFailed,
} from "@page-engine/page-testkit";
assertDiagnostic(result.diagnostics, "binding.request-target-invalid", "/dataBindings/0/operation");
assertResolutionFailed(resolution, "source.schema-invalid");
assertExecutionPlanFailed(plan, "runtime.protocol-unsupported");Compile Page Sources with @page-engine/page-compiler directly, then use
these assertions on the returned results. See the monorepo test suites
(packages/*/test) for real usage patterns and docs/ for contract
semantics.
