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

Function TestLint_ValidCommits

test/lint_test.go:56–72  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

54}
55
56func TestLint_ValidCommits(t *testing.T) {
57 linter := newDefaultLinter(t)
58 for _, tc := range validCommitCases {
59 t.Run(tc.name, func(t *testing.T) {
60 result, err := linter.ParseAndLint(tc.msg)
61 if err != nil {
62 t.Fatalf("unexpected error: %v", err)
63 }
64 if len(result.Issues()) != 0 {
65 t.Errorf("expected 0 issues for %q, got %d:", tc.msg, len(result.Issues()))
66 for _, iss := range result.Issues() {
67 t.Logf(" [%s] %s: %s", iss.Severity(), iss.RuleName(), iss.Description())
68 }
69 }
70 })
71 }
72}
73
74// ---------------------------------------------------------------------------
75// Table-driven: invalid commits (>= wantMin issues expected)

Callers

nothing calls this directly

Calls 6

newDefaultLinterFunction · 0.85
ParseAndLintMethod · 0.80
IssuesMethod · 0.80
SeverityMethod · 0.80
RuleNameMethod · 0.80
DescriptionMethod · 0.65

Tested by

no test coverage detected