schemeta/tests/render-regression.test.js
Rbanh fc5f2fee41
Some checks are pending
CI / test (push) Waiting to run
Refine group placement seeding to reduce collapse and detour
2026-02-20 00:11:01 -05:00

20 lines
785 B
JavaScript

import test from "node:test";
import assert from "node:assert/strict";
import { createHash } from "node:crypto";
import { compile } from "../src/compile.js";
import fixture from "../examples/esp32-audio.json" with { type: "json" };
function svgHash(svg) {
return createHash("sha256").update(String(svg ?? "")).digest("hex");
}
test("render output for reference fixture remains deterministic", () => {
const outA = compile(fixture, { render_mode: "schematic_stub", show_labels: true });
const outB = compile(fixture, { render_mode: "schematic_stub", show_labels: true });
assert.equal(outA.ok, true);
assert.equal(outB.ok, true);
assert.equal(outA.svg, outB.svg);
assert.equal(svgHash(outA.svg), "a793f82594e4aff3e898db85cd7e984e86ad568d58aecd33661e8bbb1eff1856");
});