Megan Honig
07/29/2024, 5:58 PMfromProviderState
matcher and am stumped by a couple of things and would appreciate some guidance.
1. Syntax: the docs show the following syntax for the matcher query: { accountNumber: fromProviderState("\${accountNumber}", "100") }
. However the linked example shows query: { accountNumber: fromProviderState('${accountNumber}', '100') }
. Which is correct: '\${varName}'
or '${varName}'
(no slashes)? Is there any difference between the two?
2. Can we inject provider state into the path of the request, or only the query? I am currently passing fromProviderState('${id}', 123)
into a function that makes an API call to /endpoint/${id}
, but this is causing the request to be made as GET /api/rest/org/getPublic/[object%20Object]
, which is obviously not the desired result.Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)