From baeb88c406380bca6d3a539565cc0eba888b36ed Mon Sep 17 00:00:00 2001 From: Sam Stoelinga Date: Tue, 5 Sep 2023 19:48:07 -0700 Subject: [PATCH] use require testing package --- internal/controller/utils_test.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/internal/controller/utils_test.go b/internal/controller/utils_test.go index 96ca8f74..13cec90b 100644 --- a/internal/controller/utils_test.go +++ b/internal/controller/utils_test.go @@ -4,6 +4,7 @@ import ( "reflect" "testing" + "github.com/stretchr/testify/require" corev1 "k8s.io/api/core/v1" ) @@ -57,13 +58,8 @@ func Test_resolveEnv(t *testing.T) { for _, tc := range testCases { t.Log("running Test_resolveEnv with input", tc.input) - actual, err := resolveEnv(tc.input) - if err != nil { - t.Errorf("error with case %v: %v", tc.input, err) - } - if !reflect.DeepEqual(actual, tc.expected) { - t.Errorf("resolveEnv(%v): expected %v, actual %v", tc.input, tc.expected, actual) - } + require.NoErrorf(t, err, "error with case %v: %v", tc.input, err) + require.Truef(t, reflect.DeepEqual(actual, tc.expected), "resolveEnv(%v): expected %v, actual %v", tc.input, tc.expected, actual) } }