I'm working with the `fromProviderState` matcher a...
# pact-js
m
I'm working with the
fromProviderState
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.
💡 1
m
I think the docs are wrong, i’ll have that fixed
👍 1
the example should work