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

Function TestDefaultFormatter_WithIssues

test/formatter_test.go:34–51  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

32}
33
34func TestDefaultFormatter_WithIssues(t *testing.T) {
35 linter := newDefaultLinter(t)
36 result, err := linter.ParseAndLint("invalid commit no type")
37 if err != nil {
38 t.Fatal(err)
39 }
40 f := &formatter.DefaultFormatter{}
41 out, fErr := f.Format(result)
42 if fErr != nil {
43 t.Fatal(fErr)
44 }
45 if strings.Contains(out, "\u2714") {
46 t.Errorf("should not have checkmark for invalid commit, got %q", out)
47 }
48 if !strings.Contains(out, "commitlint") {
49 t.Errorf("expected 'commitlint' header in output, got %q", out)
50 }
51}
52
53func TestJSONFormatter_Name(t *testing.T) {
54 f := &formatter.JSONFormatter{}

Callers

nothing calls this directly

Calls 3

FormatMethod · 0.95
newDefaultLinterFunction · 0.85
ParseAndLintMethod · 0.80

Tested by

no test coverage detected