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

Function TestConfig_NewDefault

test/config_test.go:13–40  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

11)
12
13func TestConfig_NewDefault(t *testing.T) {
14 conf := config.NewDefault()
15
16 if conf.MinVersion == "" {
17 t.Error("expected non-empty MinVersion")
18 }
19 if conf.Formatter == "" {
20 t.Error("expected non-empty Formatter")
21 }
22 if conf.Formatter != "default" {
23 t.Errorf("expected formatter 'default', got %q", conf.Formatter)
24 }
25 if len(conf.Rules) == 0 {
26 t.Error("expected non-empty rules")
27 }
28 if len(conf.Settings) == 0 {
29 t.Error("expected non-empty settings")
30 }
31 if conf.Severity.Default != lint.SeverityError {
32 t.Errorf("expected default severity 'error', got %q", conf.Severity.Default)
33 }
34 if len(conf.DefaultIgnorePatterns) == 0 {
35 t.Error("expected non-empty default ignore patterns")
36 }
37 if len(conf.IgnorePatterns) != 0 {
38 t.Error("expected empty user ignore patterns in default config")
39 }
40}
41
42func TestConfig_NewLinter(t *testing.T) {
43 conf := config.NewDefault()

Callers

nothing calls this directly

Calls 2

NewDefaultFunction · 0.92
ErrorMethod · 0.80

Tested by

no test coverage detected