(t *testing.T)
| 180 | } |
| 181 | |
| 182 | func TestValidateAccumulatesErrors(t *testing.T) { |
| 183 | entries := []*chlog.Entry{ |
| 184 | { |
| 185 | ChangeType: "fake_type", |
| 186 | Component: "component", |
| 187 | Note: "note", |
| 188 | Issues: []int{123}, |
| 189 | }, |
| 190 | { |
| 191 | ChangeType: "bug_fix", |
| 192 | Component: "", |
| 193 | Note: "note", |
| 194 | Issues: []int{456}, |
| 195 | }, |
| 196 | } |
| 197 | |
| 198 | cfg := config.New(t.TempDir()) |
| 199 | globalCfg = cfg |
| 200 | setupTestDir(t, entries) |
| 201 | |
| 202 | _, err := runCobra(t, "validate") |
| 203 | |
| 204 | assert.Error(t, err) |
| 205 | assert.ErrorContains(t, err, "'fake_type' is not a valid 'change_type'") |
| 206 | assert.ErrorContains(t, err, "specify a 'component'") |
| 207 | } |
nothing calls this directly
no test coverage detected