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

Function TestScopeEnum_Valid

test/rule_test.go:339–351  ·  view source on GitHub ↗

--- Scope rules ---

(t *testing.T)

Source from the content-addressed store, hash-verified

337// --- Scope rules ---
338
339func TestScopeEnum_Valid(t *testing.T) {
340 r := &rule.ScopeEnumRule{}
341 if err := r.Apply(lint.RuleSetting{
342 Argument: []interface{}{"auth", "core", "api"},
343 Flags: map[string]interface{}{"allow-empty": false},
344 }); err != nil {
345 t.Fatal(err)
346 }
347 _, ok := r.Validate(&mockCommit{scope: "auth"})
348 if !ok {
349 t.Error("scope 'auth' should pass")
350 }
351}
352
353func TestScopeEnum_Invalid(t *testing.T) {
354 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