// lib/selftest.ts's assertion suite, run for real.
//
// It is the app's own dev-time crypto contract: HKDF room derivations, the
// signaling/message/binary round trips with their AAD bindings, IV uniqueness
// for both sealer families, the identity assertion's room+peer binding, the
// at-rest cross-instance round trip and reject table, and the hardened access
// controller's authorship check. In the TypeScript it ran behind
// `import.meta.env.DEV`; here it is a first-class test, so a divergence in any
// of those fails `npm test` rather than a console message nobody reads.
import test from "node:test";
import assert from "node:assert/strict";
import { installDom } from "./harness/dom.mjs";
import { mods } from "./helpers/load.mjs";
installDom();
const M = await mods();
test("runSelfTest passes end to end", async () => {
const realInfo = console.info;
const lines = [];
console.info = (...a) => lines.push(a.join(" "));
try {
await M.runSelfTest();
} finally {
console.info = realInfo;
}
assert.deepEqual(lines, ["✅ crypto self-test passed"]);
});