From 9349f31dd965e71a204e63798a5cf8706dd5a452 Mon Sep 17 00:00:00 2001 From: Julien Calixte Date: Thu, 26 Feb 2026 09:54:07 +0100 Subject: [PATCH] fix: update stale markdown tests - Update test expecting a throw on missing frontmatter to match current behavior (returns defaults) - Fix invalid TOML in +++ delimiter test (quote strings and date) --- packages/cli/src/lib/markdown.test.ts | 6 +++--- packages/cli/test/markdown.test.ts | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/cli/src/lib/markdown.test.ts b/packages/cli/src/lib/markdown.test.ts index 394cd67..2089a87 100644 --- a/packages/cli/src/lib/markdown.test.ts +++ b/packages/cli/src/lib/markdown.test.ts @@ -28,9 +28,9 @@ Hello world`; test("parses TOML frontmatter with +++ delimiters", () => { const content = `+++ -title = My Post -description = A description -date = 2024-01-15 +title = "My Post" +description = "A description" +date = "2024-01-15" +++ Body content`; diff --git a/packages/cli/test/markdown.test.ts b/packages/cli/test/markdown.test.ts index f7aa692..d7ee5ac 100644 --- a/packages/cli/test/markdown.test.ts +++ b/packages/cli/test/markdown.test.ts @@ -33,11 +33,11 @@ Body content here.`; expect(body).toBe("Body content here."); }); - it("throws when no frontmatter is present", () => { + it("returns defaults when no frontmatter is present", () => { const content = "Just plain content with no frontmatter."; - expect(() => parseFrontmatter(content)).toThrow( - "Could not parse frontmatter", - ); + const { frontmatter, body } = parseFrontmatter(content); + expect(frontmatter.title).toBe(""); + expect(body).toBe(content); }); }); -- 2.54.0