Skip to content

Commit

Permalink
Merge pull request #10854 from SimonAlling/fix-confusing-test-failure…
Browse files Browse the repository at this point in the history
…-message

Fix confusing test failure message
  • Loading branch information
hickeyma committed Apr 15, 2022
2 parents a368bde + 56e52d1 commit fd1d61d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cmd/helm/helm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,11 @@ func runTestCmd(t *testing.T, tests []cmdTestCase) {
}
t.Logf("running cmd (attempt %d): %s", i+1, tt.cmd)
_, out, err := executeActionCommandC(storage, tt.cmd)
if (err != nil) != tt.wantError {
t.Errorf("expected error, got '%v'", err)
if tt.wantError && err == nil {
t.Errorf("expected error, got success with the following output:\n%s", out)
}
if !tt.wantError && err != nil {
t.Errorf("expected no error, got: '%v'", err)
}
if tt.golden != "" {
test.AssertGoldenString(t, out, tt.golden)
Expand Down

0 comments on commit fd1d61d

Please sign in to comment.