(t *testing.T)
| 32 | } |
| 33 | |
| 34 | func 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 | |
| 53 | func TestJSONFormatter_Name(t *testing.T) { |
| 54 | f := &formatter.JSONFormatter{} |
nothing calls this directly
no test coverage detected