Skip to content

Commit

Permalink
chore: 🤖 tidy test code
Browse files Browse the repository at this point in the history
  • Loading branch information
sj-williams committed Dec 6, 2024
1 parent 10fdae3 commit a6e1280
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/decodeSecret/decodeSecret_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,12 @@ func TestFormatJson(t *testing.T) {
func TestJsonNoDataKey(t *testing.T) {
jsn := `{ "key1": "1", "key2": "2" }`
sd := secretDecoder{}
expectedMsg := "unable to decode secret, does it have a data key?"
_, err := sd.processJson(jsn, false)
if err == nil {
t.Error("Expected an error when no data key is present")
}
if err.Error() != "unable to decode secret, does it have a data key?" {
t.Errorf("Expected error message 'unable to decode secret, does it have a data key?', got '%s'", err.Error())
if err.Error() != expectedMsg {
t.Errorf("Expected error message '%s', got '%s'", expectedMsg, err.Error())
}
}

0 comments on commit a6e1280

Please sign in to comment.