Open Danny02 opened 6 years ago
Sorry, pact spec v3 is not supported in js yet. Which feature were you particularly interested in?
The pact specification is not passed in when pact_mock-service calls the MatchingRules.extract function in pact-support
https://github.com/pact-foundation/pact-support/blob/master/lib/pact/matching_rules.rb#L11
I've added a commit and pull request that will pass the spec version used.
https://github.com/pact-foundation/pact-mock_service/pull/159
however the matching rules are written incorrectly.
pact-message-ruby attempts to correct this here
whereby it would write
"matchingRules": {
"body": {
"$.email": {
"match": "type"
},
"$.first_name": {
"match": "type"
}
}
}
but it should write
"matchingRules": {
"body": {
"$.email": {
"matchers": [
{
"match": "type"
}
]
},
"$.first_name": {
"matchers": [
{
"match": "type"
}
]
}
}
}
I'm using Pact-JS (+pact-js-karma) to test my consumer tests and want to generate Pact files according to version 3 of the Pact spec. I think that I have set the spec option correctly, because the resulting pact file includes
The generated matching rules are in v2 format:
Our expectation regarding the generated output according to spec v3 was something like: