(t *testing.T)
| 139 | } |
| 140 | |
| 141 | func TestCustomSummary(t *testing.T) { |
| 142 | brk1 := Entry{ |
| 143 | ChangeType: Breaking, |
| 144 | Component: "foo", |
| 145 | Note: "broke foo", |
| 146 | Issues: []int{123}, |
| 147 | } |
| 148 | brk2 := Entry{ |
| 149 | ChangeType: Breaking, |
| 150 | Component: "bar", |
| 151 | Note: "broke bar", |
| 152 | Issues: []int{345, 678}, |
| 153 | SubText: "more details", |
| 154 | } |
| 155 | |
| 156 | actual, err := GenerateSummary("1.0", []*Entry{&brk1, &brk2}, &config.Config{SummaryTemplate: filepath.Join("testdata", "custom.tmpl")}) |
| 157 | require.NoError(t, err) |
| 158 | |
| 159 | // This file is not meant to be the entire changelog so will not pass markdownlint if named with .md extension. |
| 160 | expected, err := os.ReadFile(filepath.Join("testdata", "CHANGELOG_custom")) |
| 161 | require.NoError(t, err) |
| 162 | |
| 163 | assert.Equal(t, string(expected), actual) |
| 164 | } |
nothing calls this directly
no test coverage detected