MCPcopy Index your code
hub / github.com/conventionalcommit/commitlint / TestBodyLeadingBlank_WithoutBlank_Fail

Function TestBodyLeadingBlank_WithoutBlank_Fail

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

Source from the content-addressed store, hash-verified

1080}
1081
1082func TestBodyLeadingBlank_WithoutBlank_Fail(t *testing.T) {
1083 r := &rule.BodyLeadingBlankRule{}
1084 if err := r.Apply(lint.RuleSetting{}); err != nil {
1085 t.Fatal(err)
1086 }
1087 msg := &mockCommit{
1088 message: "feat: add feature\nThis is the body",
1089 body: "This is the body",
1090 }
1091 _, ok := r.Validate(msg)
1092 if ok {
1093 t.Error("body without leading blank line should fail")
1094 }
1095}
1096
1097func TestBodyLeadingBlank_EmptyBody_Pass(t *testing.T) {
1098 r := &rule.BodyLeadingBlankRule{}

Callers

nothing calls this directly

Calls 3

ApplyMethod · 0.95
ValidateMethod · 0.95
ErrorMethod · 0.80

Tested by

no test coverage detected