test.govlab/context/core/stores/check.store.test.ts
test.govlab/context/core/stores/check.store.test.ts is a file in Codebase Testing. 18 lines of code and 0 definitions.
import { CheckTable } from "@govlab/context/core/stores/check.store.ts";
import assert from "node:assert/strict";
import { test } from "vitest";
test("a record's own check merges over its kind's, and a value that is not a check is ignored", () => {
const table = new CheckTable();
table.forKind("technique", { authority: "the kind rule", population: "every technique" });
table.forRecord("technique", "unit-testing", { population: "the one technique" });
table.forRecord("technique", "ignored", "loose");
assert.deepEqual(table.checkOf("technique", "unit-testing"), {
authority: "the kind rule",
population: "the one technique",
});
assert.deepEqual(table.checkOf("technique", "ignored"), {
authority: "the kind rule",
population: "every technique",
});
assert.equal(table.checkOf("lens", "any"), null);
});