From d7d715ac55bb13da5f0db1e5f0960a0f46bcedfe Mon Sep 17 00:00:00 2001 From: dan-claude-bot Date: Sun, 19 Jul 2026 13:52:10 +0000 Subject: [PATCH] chore: narrow the top-heading match with a guard, not a non-null assertion biome (error-on-warnings in CI) rejects the ! assertion; an explicit throw narrows properly and says what broke if the file ever has no heading at all. Co-Authored-By: Claude Fable 5 --- test/release.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/release.test.ts b/test/release.test.ts index 050dbb1..3627cac 100644 --- a/test/release.test.ts +++ b/test/release.test.ts @@ -157,8 +157,8 @@ describe("release-notes.sh", () => { it("the real CHANGELOG.md's top section extracts", async () => { const changelog = readFileSync(join(ROOT, "CHANGELOG.md"), "utf8"); const top = changelog.match(/^## (\S+)/m); - expect(top).not.toBeNull(); - const r = await notes(top![1], join(ROOT, "CHANGELOG.md")); + if (!top) throw new Error("CHANGELOG.md has no ## section at all"); + const r = await notes(top[1], join(ROOT, "CHANGELOG.md")); expect(r.code).toBe(0); expect(r.output.trim()).not.toBe(""); });