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

Function TestLint_DefaultSeverityIsError

test/lint_test.go:193–207  ·  view source on GitHub ↗

--------------------------------------------------------------------------- Severity tests ---------------------------------------------------------------------------

(t *testing.T)

Source from the content-addressed store, hash-verified

191// ---------------------------------------------------------------------------
192
193func TestLint_DefaultSeverityIsError(t *testing.T) {
194 linter := newDefaultLinter(t)
195 result, err := linter.ParseAndLint("unknown: some message here")
196 if err != nil {
197 t.Fatalf("unexpected error: %v", err)
198 }
199 if len(result.Issues()) == 0 {
200 t.Fatal("expected at least one issue")
201 }
202 for _, iss := range result.Issues() {
203 if iss.Severity() != lint.SeverityError {
204 t.Errorf("expected error severity, got %q for %s", iss.Severity(), iss.RuleName())
205 }
206 }
207}
208
209func TestLint_CustomWarningSeverity(t *testing.T) {
210 conf := config.NewDefault()

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected