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

Function TestScopeEnum_EmptyNotAllowed

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

Source from the content-addressed store, hash-verified

379}
380
381func TestScopeEnum_EmptyNotAllowed(t *testing.T) {
382 r := &rule.ScopeEnumRule{}
383 if err := r.Apply(lint.RuleSetting{
384 Argument: []interface{}{"auth"},
385 Flags: map[string]interface{}{"allow-empty": false},
386 }); err != nil {
387 t.Fatal(err)
388 }
389 _, ok := r.Validate(&mockCommit{scope: ""})
390 if ok {
391 t.Error("empty scope with allow-empty=false should fail")
392 }
393}
394
395func TestScopeMinLen_Pass(t *testing.T) {
396 r := &rule.ScopeMinLenRule{}

Callers

nothing calls this directly

Calls 3

ApplyMethod · 0.95
ValidateMethod · 0.95
ErrorMethod · 0.80

Tested by

no test coverage detected