mirror of
https://github.com/apricote/releaser-pleaser.git
synced 2026-01-13 21:21:03 +00:00
chore: fix various tests
This commit is contained in:
parent
3b6aca0f9b
commit
5e52f82a28
3 changed files with 7 additions and 13 deletions
|
|
@ -21,7 +21,6 @@ func TestUpdateChangelogFile(t *testing.T) {
|
|||
repoFn testutils.Repo
|
||||
entry string
|
||||
expectedContent string
|
||||
newFile bool
|
||||
wantErr assert.ErrorAssertionFunc
|
||||
}{
|
||||
{
|
||||
|
|
@ -29,7 +28,6 @@ func TestUpdateChangelogFile(t *testing.T) {
|
|||
repoFn: testutils.WithTestRepo(),
|
||||
entry: "## v1.0.0\n",
|
||||
expectedContent: "# Changelog\n\n## v1.0.0\n",
|
||||
newFile: true,
|
||||
wantErr: assert.NoError,
|
||||
},
|
||||
{
|
||||
|
|
@ -81,13 +79,8 @@ func TestUpdateChangelogFile(t *testing.T) {
|
|||
|
||||
changelogFileStatus := wtStatus.File(ChangelogFile)
|
||||
|
||||
if tt.newFile {
|
||||
assert.Equal(t, git.Unmodified, changelogFileStatus.Worktree, "unexpected file status in worktree")
|
||||
assert.Equal(t, git.Added, changelogFileStatus.Staging, "unexpected file status in staging")
|
||||
} else {
|
||||
assert.Equal(t, git.Modified, changelogFileStatus.Worktree, "unexpected file status in worktree")
|
||||
assert.Equal(t, git.Modified, changelogFileStatus.Staging, "unexpected file status in staging")
|
||||
}
|
||||
assert.Equal(t, git.Unmodified, changelogFileStatus.Worktree, "unexpected file status in worktree")
|
||||
assert.Equal(t, git.Added, changelogFileStatus.Staging, "unexpected file status in staging")
|
||||
|
||||
changelogFile, err := wt.Filesystem.Open(ChangelogFile)
|
||||
require.NoError(t, err)
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ func reconcileReleasePR(ctx context.Context, forge rp.Forge, changesets []rp.Cha
|
|||
}
|
||||
|
||||
if pr != nil {
|
||||
logger.InfoContext(ctx, "found existing release pull request: %d: %s", pr.ID, pr.Title)
|
||||
logger.InfoContext(ctx, "found existing release pull request", "pr.id", pr.ID, "pr.title", pr.Title)
|
||||
}
|
||||
|
||||
var releaseOverrides rp.ReleaseOverrides
|
||||
|
|
|
|||
|
|
@ -110,9 +110,10 @@ func TestAnalyzeCommits(t *testing.T) {
|
|||
Description: "blabla",
|
||||
},
|
||||
{
|
||||
Commit: Commit{Message: "feat!: foobar"},
|
||||
Type: "feat",
|
||||
Description: "foobar",
|
||||
Commit: Commit{Message: "feat!: foobar"},
|
||||
Type: "feat",
|
||||
Description: "foobar",
|
||||
BreakingChange: true,
|
||||
},
|
||||
},
|
||||
expectedBump: conventionalcommits.MajorVersion,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue