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

Function TestConfig_Parse_InvalidYAML

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

Source from the content-addressed store, hash-verified

380}
381
382func TestConfig_Parse_InvalidYAML(t *testing.T) {
383 tmpDir := t.TempDir()
384 confPath := filepath.Join(tmpDir, "commitlint.yaml")
385
386 err := os.WriteFile(confPath, []byte("invalid: yaml: content: ["), 0o644)
387 if err != nil {
388 t.Fatalf("failed to write config file: %v", err)
389 }
390
391 _, err = config.Parse(confPath)
392 if err == nil {
393 t.Error("expected error for invalid YAML")
394 }
395}
396
397func TestConfig_GetEnabledRules(t *testing.T) {
398 conf := config.NewDefault()

Callers

nothing calls this directly

Calls 2

ParseFunction · 0.92
ErrorMethod · 0.80

Tested by

no test coverage detected