MCPcopy Index your code
hub / github.com/databus23/helm-diff / TestLocalCmdNoChanges

Function TestLocalCmdNoChanges

cmd/local_test.go:73–103  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

71}
72
73func TestLocalCmdNoChanges(t *testing.T) {
74 manifestYAML := `---
75apiVersion: v1
76kind: ConfigMap
77metadata:
78 name: test-config
79 namespace: default
80data:
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
105func TestLocalCmdWithChanges(t *testing.T) {
106 manifest1 := `---

Callers

nothing calls this directly

Calls 3

setupFakeHelmFunction · 0.85
captureStdoutFunction · 0.85
localCmdFunction · 0.85

Tested by

no test coverage detected