import test from "node:test"; import assert from "node:assert/strict"; import profile from "../content/profile.json" with { type: "json" }; import projects from "../content/projects.json" with { type: "json" }; import { validateContent } from "../lib/content-schema.ts"; test("the reviewed inventory requires implemented layers and their source artifacts", () => { assert.doesNotThrow(() => validateContent(profile, projects)); for (const change of [ { availableDepths: [0, 1, 1] }, { availableDepths: [1] }, { availableDepths: [0, 4] }, { caseStudy: undefined }, { caseStudy: "unknown" }, { artifacts: projects[1].artifacts }, { status: "expert" }, { contribution: "" }, { slug: projects[1].slug }, { anchorId: projects[1].anchorId }, { artifacts: [ { kind: "source", title: "Source", href: "//unreviewed.invalid" }, ], }, ]) { assert.throws(() => validateContent(profile, [{ ...projects[0], ...change }, projects[1]]), ); } }); test("the profile requires a valid contact, feature and reviewed PDF path", () => { for (const change of [ { email: "" }, { featuredSlug: "missing" }, { resumePdf: "/private/resume.pdf" }, ]) { assert.throws(() => validateContent({ ...profile, ...change }, projects)); } });