Chit Chinwah
06/13/2022, 9:28 AMenum value {
optionA
optionB
optionC
}
The response returns the value which was sent in the request like this(assuming โoptionAโ was sent in the request):
data: {
value: {
selectedValue: 'optionA'
}
}
My question is, what is the best way in pact-js
to verify that only one of the possible 3 values is accepted? is there some sort of way of checking that only one of these values is accepted in the response? Thanks in advance for your help! ๐๐พ๐๐พ.Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Chit Chinwah
06/13/2022, 10:12 AMMatt (pactflow.io / pact-js / pact-go)
Timothy Jones
06/14/2022, 3:03 AMTimothy Jones
06/14/2022, 3:07 AMuserType
in response to GET /users/{someid}
. In that case, I would use a matcher.
โข There are cases where although the spec says there could be multiple answers, only one of them would be valid in that response - for example, if the full user entity is returned in response to a POST request that sets the user's type
to admin
, you'd expect it to be exactly admin
. In that case, I don't use a matcher.