Skip to content

Commit 48e76d0

Browse files
committed
Add extractChangelogSnippet test for the case where there is no first section
1 parent 49065ef commit 48e76d0

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎pr-checks/prepare-changelog.test.ts‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,12 @@ describe("extractChangelogSnippet", async () => {
4343
const result = extractChangelogSnippet(changelogPath);
4444
assert.deepEqual(result, testBody);
4545
});
46+
47+
await it("returns an empty string if there is no first section", async () => {
48+
const changelogPath = path.join(testDir, "test-readme.md");
49+
fs.writeFileSync(changelogPath, "# CodeQL Action Changelog\n");
50+
51+
const result = extractChangelogSnippet(changelogPath);
52+
assert.deepEqual(result, "");
53+
});
4654
});

0 commit comments

Comments
 (0)