Skip to content

Commit

Permalink
Replaced isErr with wantErr in TestNew
Browse files Browse the repository at this point in the history
  • Loading branch information
MrAlias committed Feb 1, 2024
1 parent 9f117ab commit b9ea2aa
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions sdk/resource/resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ func TestNew(t *testing.T) {

resourceValues map[string]string
schemaURL string
isErr bool
wantErr error
}{
{
name: "No Options returns empty resource",
Expand Down Expand Up @@ -413,7 +413,7 @@ func TestNew(t *testing.T) {
}(),
},
schemaURL: "",
isErr: true,
wantErr: resource.ErrSchemaURLConflict,
},
{
name: "With conflicting detector schema urls",
Expand All @@ -432,7 +432,7 @@ func TestNew(t *testing.T) {
}(),
},
schemaURL: "",
isErr: true,
wantErr: resource.ErrSchemaURLConflict,
},
}
for _, tt := range tc {
Expand All @@ -446,10 +446,10 @@ func TestNew(t *testing.T) {
ctx := context.Background()
res, err := resource.New(ctx, tt.options...)

if tt.isErr {
require.Error(t, err)
if tt.wantErr != nil {
assert.ErrorIs(t, err, tt.wantErr)
} else {
require.NoError(t, err)
assert.NoError(t, err)
}

require.EqualValues(t, tt.resourceValues, toMap(res))
Expand Down

0 comments on commit b9ea2aa

Please sign in to comment.