Add extractChangelogSnippet test for the case where there is no first section

This commit is contained in:
Michael B. Gale
2026-07-24 13:41:35 +01:00
parent 57eb44123f
commit 093dce6cc2

View File

@@ -43,4 +43,12 @@ describe("extractChangelogSnippet", async () => {
const result = extractChangelogSnippet(changelogPath);
assert.deepEqual(result, testBody);
});
await it("returns an empty string if there is no first section", async () => {
const changelogPath = path.join(testDir, "test-readme.md");
fs.writeFileSync(changelogPath, "# CodeQL Action Changelog\n");
const result = extractChangelogSnippet(changelogPath);
assert.deepEqual(result, "");
});
});