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

Function TestFooterEnum_Valid

test/rule_test.go:476–489  ·  view source on GitHub ↗

--- Footer enum rule ---

(t *testing.T)

Source from the content-addressed store, hash-verified

474// --- Footer enum rule ---
475
476func TestFooterEnum_Valid(t *testing.T) {
477 r := &rule.FooterEnumRule{}
478 if err := r.Apply(lint.RuleSetting{
479 Argument: []interface{}{"Fixes", "Reviewed-by", "BREAKING CHANGE"},
480 }); err != nil {
481 t.Fatal(err)
482 }
483 _, ok := r.Validate(&mockCommit{
484 notes: []lint.Note{&mockNote{token: "Fixes", value: "#123"}},
485 })
486 if !ok {
487 t.Error("known footer token should pass")
488 }
489}
490
491func TestFooterEnum_Invalid(t *testing.T) {
492 r := &rule.FooterEnumRule{}

Callers

nothing calls this directly

Calls 3

ApplyMethod · 0.95
ValidateMethod · 0.95
ErrorMethod · 0.80

Tested by

no test coverage detected