<#745 Use matchers when verifying metadata> Issue ...
# pact-js-development
g
#745 Use matchers when verifying metadata Issue created by mduesterhoeft Feature description Since v10.0.0-beta.45
metaData
present in the consumer contract is verified. It would be great if we could also use matches when verifying metadata. Something like this should be working.
Copy code
"messages": [
    {
      "matchingRules": {
        "body": {},
        "metaData": {
          "$.traceId": { "combine": "AND", "matchers": [{ "match": "type" }] }
        }
      },
      "metaData": {
        "traceId": "8bf558a2-0b0d-457e-b1b2-75800352d637"
      }
    }
  ]
Use case The metaData object contains a
traceId
which is change whenever the consumer contract is published. The verification should just make sure that the field exists and carries a string. A match by value is not useful. pact-foundation/pact-js