mirror of
https://github.com/lukaszraczylo/semver-generator.git
synced 2026-07-11 04:31:48 +00:00
Improve test coverage.
This commit is contained in:
@@ -0,0 +1,24 @@
|
|||||||
|
package cmd
|
||||||
|
|
||||||
|
import "testing"
|
||||||
|
|
||||||
|
func Test_checkLatestRelease(t *testing.T) {
|
||||||
|
tests := []struct {
|
||||||
|
name string
|
||||||
|
want string
|
||||||
|
want1 bool
|
||||||
|
}{
|
||||||
|
{
|
||||||
|
name: "Check latest release",
|
||||||
|
want1: true,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
for _, tt := range tests {
|
||||||
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
|
_, got1 := checkLatestRelease()
|
||||||
|
if got1 != tt.want1 {
|
||||||
|
t.Errorf("checkLatestRelease() got1 = %v, want %v", got1, tt.want1)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -38,6 +38,7 @@ var (
|
|||||||
func (suite *Tests) SetupTest() {
|
func (suite *Tests) SetupTest() {
|
||||||
os.Chdir(testCurrentPath)
|
os.Chdir(testCurrentPath)
|
||||||
assert = assertions.New(suite.T())
|
assert = assertions.New(suite.T())
|
||||||
|
varDebug = true
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestSuite(t *testing.T) {
|
func TestSuite(t *testing.T) {
|
||||||
|
|||||||
Reference in New Issue
Block a user