Skip to content

Commit

Permalink
Fix validator test to handle varying error message order
Browse files Browse the repository at this point in the history
  • Loading branch information
muzzammilshahid committed Sep 20, 2024
1 parent 0cbf66d commit 2bd4e84
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions messages/validator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -405,8 +405,12 @@ func TestValidateMessage(t *testing.T) {
wampMsg := []any{1, "io.xconn.test", map[string]any{}, "invalidType", "extra"}
_, err := messages.ValidateMessage(wampMsg, spec)

require.EqualError(t, err, `item at index 3 must be of type []any but was string
item at index 4 must be of type map[string]any but was string`)
require.Contains(t, []string{
`item at index 3 must be of type []any but was string
item at index 4 must be of type map[string]any but was string`,
`item at index 4 must be of type map[string]any but was string
item at index 3 must be of type []any but was string`,
}, err.Error())
})
}

Expand Down

0 comments on commit 2bd4e84

Please sign in to comment.