MCPcopy Create free account
hub / github.com/conventionalcommit/commitlint / TestBodyMinLen_Fail

Function TestBodyMinLen_Fail

test/rule_test.go:113–122  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

111}
112
113func TestBodyMinLen_Fail(t *testing.T) {
114 r := &rule.BodyMinLenRule{}
115 if err := r.Apply(lint.RuleSetting{Argument: 20}); err != nil {
116 t.Fatal(err)
117 }
118 _, ok := r.Validate(&mockCommit{body: "short"})
119 if ok {
120 t.Error("body < 20 should fail")
121 }
122}
123
124func TestBodyMaxLen_NegativeDisables(t *testing.T) {
125 r := &rule.BodyMaxLenRule{}

Callers

nothing calls this directly

Calls 3

ApplyMethod · 0.95
ValidateMethod · 0.95
ErrorMethod · 0.80

Tested by

no test coverage detected