Files
kryptkeeper/scripts/validate-playbooks.test.mjs
bpmforge e0d82a4ed0 Kryptkeeper 1.0.0
First stable release. Notes: docs/release/RELEASE_NOTES_v1.0.0.md
Lab record: docs/release/LIVE_RESULTS_v1.0.0.md
2026-10-19 14:43:23 -04:00

18 lines
646 B
JavaScript

import test from "node:test";
import assert from "node:assert/strict";
import { lintPlaybook, REQUIRED } from "./validate-playbooks.mjs";
const body = "a\nb\nc\n";
const good = REQUIRED.map((h) => `## ${h}\n${body}`).join("\n");
test("good playbook passes", () => {
assert.deepEqual(lintPlaybook(good), []);
});
test("missing heading and thin section fail", () => {
const bad = good.replace("## Rollback", "## Back out").replace(/## Prerequisites\na\nb\nc\n/, "## Prerequisites\na\n");
const errs = lintPlaybook(bad);
assert.ok(errs.some((e) => e.includes("Rollback")));
assert.ok(errs.some((e) => e.includes("Prerequisites")));
});