We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Eachkeylike matcher is not working as expected
Eachkeylike
const modelResponse = { categories: { additionalProp1: { id: 'string', items: ['string'], name: 'string', sortOrder: 0, }, additionalProp2: { id: 'string', items: ['string'], name: 'string', sortOrder: 0, }, // Nth additional Prop additionalPropN: { id: 'string', items: ['string'], name: 'string', sortOrder: 0, }, }, };
This is a JS matcher implementation
const expectation = { categories: eachKeyLike('1SMKX6JGWKY3J', { id: regex(/^[A-Z0-9]+$/,'1SMKX6JGWKY3J'), name: string('Dessert'), sortOrder: integer(3), items: atLeastOneLike(string('F79QJX241ZAHP')), }) }
Actual response from provider
const actualResponse = { categories: { '4KS8YA1PY4YPC': { id: '4KS8YA1PY4YPC', name: 'Plain ol\' Crepe', sortOrder: 1, items: ['19AGCTC43X5YC'], }, 'D70N53J6R34K9': { id: '41SJNCEK3FXTJ', name: 'Flavored Crepes', sortOrder: 0, items: ['D70N53J6R34K9'], }, }, }
However getting a error log as following
1.1) body: $.categories Expected 1SMKX6JGWKY3J={"id":"1SMKX6JGWKY3J","items":["F79QJX241ZAHP"],"name":"Dessert","sortOrder":3} but was missing { + "4KS8YA1PY4YPC": { + "id": "4KS8YA1PY4YPC", - "1SMKX6JGWKY3J": { - "id": "1SMKX6JGWKY3J", + "name": "Plain ol' Crepe", - "name": "Dessert", + "sortOrder": 1, - "sortOrder": 3 "items": [ + "19AGCTC43X5YC" + ] - "F79QJX241ZAHP" - ], + }, + "D70N53J6R34K9": { + "id": "D70N53J6R34K9", + "name": "Flavored Crepes", + "sortOrder": 0, + "items": [ + "19AGCTC43X5YC" + ] }
The text was updated successfully, but these errors were encountered:
What version of Pact-JVM are you using? The Pact-JS eachKeyLike matcher is using the values matching rule, which requires Pact-JVM 4.2.x.
eachKeyLike
values
Sorry, something went wrong.
chore: add provider verification test with pact file from Pact-JS V3 #…
ea989c0
…1434
a8d989a
It seems working as expected with Pact-JVM 4.2.8. I was testing with 4.1.x versions.
Pact-JVM 4.2.8
4.1.x
No branches or pull requests
Eachkeylike
matcher is not working as expectedThis is a JS matcher implementation
Actual response from provider
However getting a error log as following
The text was updated successfully, but these errors were encountered: