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

Function TestScopeEnum_EmptyAllowed

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

Source from the content-addressed store, hash-verified

365}
366
367func TestScopeEnum_EmptyAllowed(t *testing.T) {
368 r := &rule.ScopeEnumRule{}
369 if err := r.Apply(lint.RuleSetting{
370 Argument: []interface{}{"auth"},
371 Flags: map[string]interface{}{"allow-empty": true},
372 }); err != nil {
373 t.Fatal(err)
374 }
375 _, ok := r.Validate(&mockCommit{scope: ""})
376 if !ok {
377 t.Error("empty scope with allow-empty=true should pass")
378 }
379}
380
381func TestScopeEnum_EmptyNotAllowed(t *testing.T) {
382 r := &rule.ScopeEnumRule{}

Callers

nothing calls this directly

Calls 3

ApplyMethod · 0.95
ValidateMethod · 0.95
ErrorMethod · 0.80

Tested by

no test coverage detected