File tree Expand file tree Collapse file tree 3 files changed +47
-0
lines changed
Expand file tree Collapse file tree 3 files changed +47
-0
lines changed Original file line number Diff line number Diff line change @@ -85,6 +85,9 @@ type ParseChangeLogs() =
8585
8686 [<Output>]
8787 member val UnreleasedChangelog : ITaskItem = null with get, set
88+
89+ [<Output>]
90+ member val UnreleasedReleaseNotes : string = null with get, set
8891
8992 [<Output>]
9093 member val CurrentReleaseChangelog : ITaskItem = null with get, set
@@ -132,6 +135,7 @@ type ParseChangeLogs() =
132135 | null -> Ok()
133136 | unreleased ->
134137 this.UnreleasedChangelog <- unreleased.ToTaskItem()
138+ this.UnreleasedReleaseNotes <- unreleased.SubSectionCollection.ToMarkdown()
135139 Ok()
136140
137141 member this.ProcessReleases ( changelog : Changelog ) =
Original file line number Diff line number Diff line change @@ -130,6 +130,30 @@ type UnitTests() =
130130
131131### Changed
132132
133+ - Changed something in the package
134+ - Updated the target framework"""
135+ )
136+
137+ [<TestMethod>]
138+ member this. ``task adds pre - release when an unreleased section is present`` () =
139+ let myTask = ParseChangeLogs( ChangelogFile = Workspace.changelogs.`` CHANGELOG.md `` )
140+
141+ myTask.BuildEngine <- this.context.BuildEngine.Object
142+
143+ let success = myTask.Execute()
144+ % success.Should() .BeTrue " Should have successfully parsed the changelog data"
145+
146+ % myTask.CurrentReleaseChangelog
147+
148+ % myTask.LatestReleaseNotes
149+ .Should()
150+ .Be(
151+ """ ### Added
152+
153+ - Created the package
154+
155+ ### Changed
156+
133157- Changed something in the package
134158- Updated the target framework"""
135159 )
Original file line number Diff line number Diff line change 1+ # Changelog
2+
3+ ## [ Unreleased]
4+
5+ ### Removed
6+
7+ - A test removal line
8+ - And another removal
9+
10+ ## [ 0.1.0] - 2022-01-13
11+
12+ ### Added
13+
14+ - Created the package
15+
16+ ### Changed
17+
18+ - Changed something in the package
19+ - Updated the target framework
You can’t perform that action at this time.
0 commit comments