Files
obsidian-jekyll-publish/src/buildPost.test.ts
Claude bf7f993026 feat: assemble final post text
Co-Authored-By: Claude
2026-06-19 01:56:20 +00:00

15 lines
490 B
TypeScript

import { expect, test } from "vitest";
import { buildPost } from "./buildPost";
test("assembles frontmatter + body with single trailing newline", () => {
const out = buildPost({
frontmatterPairs: [{ key: "layout", value: "post" }],
body: "Hello world",
});
expect(out).toBe("---\nlayout: post\n---\n\nHello world\n");
});
test("empty frontmatter still emits a delimiter block", () => {
expect(buildPost({ frontmatterPairs: [], body: "x" })).toBe("---\n\n---\n\nx\n");
});