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

Function TestScopeEnum_Invalid

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

Source from the content-addressed store, hash-verified

351}
352
353func TestScopeEnum_Invalid(t *testing.T) {
354 r := &rule.ScopeEnumRule{}
355 if err := r.Apply(lint.RuleSetting{
356 Argument: []interface{}{"auth", "core"},
357 Flags: map[string]interface{}{"allow-empty": false},
358 }); err != nil {
359 t.Fatal(err)
360 }
361 _, ok := r.Validate(&mockCommit{scope: "unknown"})
362 if ok {
363 t.Error("scope 'unknown' should fail")
364 }
365}
366
367func TestScopeEnum_EmptyAllowed(t *testing.T) {
368 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