Compare commits
2 Commits
309aa09114
...
96f507fbe3
| Author | SHA1 | Date | |
|---|---|---|---|
|
96f507fbe3
|
|||
|
c9bad27e1d
|
@@ -8,7 +8,7 @@ import (
|
|||||||
func TestParse(t *testing.T) {
|
func TestParse(t *testing.T) {
|
||||||
t.Run("no args", func(t *testing.T) {
|
t.Run("no args", func(t *testing.T) {
|
||||||
error,ctype,cscope,shouldCommit,shouldStage,cmessage := Parse([]string{})
|
error,ctype,cscope,shouldCommit,shouldStage,cmessage := Parse([]string{})
|
||||||
assert.Equal(t, error, nil)
|
assert.NotEqual(t, error, nil)
|
||||||
assert.Equal(t, ctype, "")
|
assert.Equal(t, ctype, "")
|
||||||
assert.Equal(t, cscope, "")
|
assert.Equal(t, cscope, "")
|
||||||
var wantedMessage []string
|
var wantedMessage []string
|
||||||
@@ -16,4 +16,15 @@ func TestParse(t *testing.T) {
|
|||||||
assert.Equal(t, shouldCommit, false)
|
assert.Equal(t, shouldCommit, false)
|
||||||
assert.Equal(t, shouldStage, false)
|
assert.Equal(t, shouldStage, false)
|
||||||
})
|
})
|
||||||
|
t.Run("only type", func(t *testing.T) {
|
||||||
|
error,ctype,cscope,shouldCommit,shouldStage,cmessage := Parse([]string{"fix"})
|
||||||
|
assert.Equal(t, error, nil)
|
||||||
|
assert.Equal(t, ctype, "fix")
|
||||||
|
assert.Equal(t, cscope, "")
|
||||||
|
var wantedMessage []string
|
||||||
|
assert.DeepEqual(t, cmessage, wantedMessage)
|
||||||
|
assert.Equal(t, shouldCommit, false)
|
||||||
|
assert.Equal(t, shouldStage, false)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user