chore(go): add release note extraction tests

This commit is contained in:
Micheal Wilkinson
2026-03-21 14:33:48 +00:00
parent e625d475a5
commit 9dc28e8229
2 changed files with 26 additions and 0 deletions

View File

@@ -128,6 +128,19 @@ func (s *PrepareSuite) TestUnreleasedBody_ReturnsErrorWhenUnreleasedSectionMissi
require.ErrorContains(s.T(), err, "unreleased section")
}
func (s *PrepareSuite) TestReleaseNotes_ReturnsReleaseSectionForVersion() {
notes, err := vociferate.ReleaseNotes(s.rootDir, "1.1.6", vociferate.Options{})
require.NoError(s.T(), err)
require.Equal(s.T(), "## [1.1.6] - 2017-12-20\n\n### Fixed\n\n- Historical note.\n", notes)
}
func (s *PrepareSuite) TestReleaseNotes_ReturnsErrorWhenVersionSectionMissing() {
_, err := vociferate.ReleaseNotes(s.rootDir, "9.9.9", vociferate.Options{})
require.ErrorContains(s.T(), err, "release notes section")
}
func (s *PrepareSuite) TestRecommendedTag_ReturnsErrorWhenUnreleasedHasOnlyTemplateHeadings() {
require.NoError(s.T(), os.WriteFile(
filepath.Join(s.rootDir, "CHANGELOG.md"),