chore(go): add release note extraction tests
This commit is contained in:
@@ -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"),
|
||||
|
||||
Reference in New Issue
Block a user