(t *testing.T)
| 71 | } |
| 72 | |
| 73 | func TestLocalCmdNoChanges(t *testing.T) { |
| 74 | manifestYAML := `--- |
| 75 | apiVersion: v1 |
| 76 | kind: ConfigMap |
| 77 | metadata: |
| 78 | name: test-config |
| 79 | namespace: default |
| 80 | data: |
| 81 | key: value |
| 82 | ` |
| 83 | setupFakeHelm(t, "default", manifestYAML, "", "") |
| 84 | |
| 85 | chart1 := t.TempDir() |
| 86 | chart2 := t.TempDir() |
| 87 | |
| 88 | output, err := captureStdout(func() { |
| 89 | cmd := localCmd() |
| 90 | cmd.SetArgs([]string{chart1, chart2}) |
| 91 | |
| 92 | if execErr := cmd.Execute(); execErr != nil { |
| 93 | t.Errorf("Expected no error but got: %v", execErr) |
| 94 | } |
| 95 | }) |
| 96 | |
| 97 | if err != nil { |
| 98 | t.Fatalf("Failed to capture stdout: %v", err) |
| 99 | } |
| 100 | if output != "" { |
| 101 | t.Errorf("Expected no output when charts are identical, got: %q", output) |
| 102 | } |
| 103 | } |
| 104 | |
| 105 | func TestLocalCmdWithChanges(t *testing.T) { |
| 106 | manifest1 := `--- |
nothing calls this directly
no test coverage detected