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

Function TestTrailerExists_Present_Pass

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

Source from the content-addressed store, hash-verified

1250}
1251
1252func TestTrailerExists_Present_Pass(t *testing.T) {
1253 r := &rule.TrailerExistsRule{}
1254 if err := r.Apply(lint.RuleSetting{Argument: "Co-authored-by:"}); err != nil {
1255 t.Fatal(err)
1256 }
1257 _, ok := r.Validate(&mockCommit{notes: []lint.Note{&mockNote{token: "Co-authored-by", value: "Bob <bob@example.com>"}}})
1258 if !ok {
1259 t.Error("commit with Co-authored-by note should pass")
1260 }
1261}
1262
1263func TestTrailerExists_Missing_Fail(t *testing.T) {
1264 r := &rule.TrailerExistsRule{}

Callers

nothing calls this directly

Calls 3

ApplyMethod · 0.95
ValidateMethod · 0.95
ErrorMethod · 0.80

Tested by

no test coverage detected