Skip to content

Commit

Permalink
chore: update get latest tag unit test
Browse files Browse the repository at this point in the history
Co-authored-by: Rizky Eko Putra <[email protected]>
  • Loading branch information
rizkyekoputra and rizkyekoputra committed Oct 18, 2022
1 parent 9666394 commit a8448c9
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions pkg/gitlab/tag_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package gitlab_test

import (
"testing"

"github.com/gopaytech/go-commons/pkg/gitlab"
"github.com/stretchr/testify/assert"
)

func Test_tag_GetLatestTag(t *testing.T) {
t.Run("Get file from branch testing should success", func(t *testing.T) {
client, err := gitlab.NewClient("https://gitlab.com", "")
assert.NoError(t, err)

projectClient := gitlab.NewTag(client)

tag, err := projectClient.GetLatestTag(gitlab.NameOrId{ID: 17954603}, "^v")
assert.NoError(t, err)
assert.NotNil(t, tag)
assert.Equal(t, "v1.0.0", tag.Name)
})
}

0 comments on commit a8448c9

Please sign in to comment.