You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When writing a pact test and describing a value in body using an updated matcher, the change to that matcher is not reflected in the pact file.
If the pact file is deleted before running updated again, then the update is reflected in the pact file.
🦶 Reproduction Steps
Setup a pact test environment
Write a pact test where .willRespondWith(body:) contains a matcher:
The changes to min: and max: are not recorded and remain set to max: 5 and min: 0
⑂ Possible workaround(s)
Before running the tests again with the changes to any of the matchers (tested with changing a SomethingLike() to EqualTo()), remove any existing pact files in order to completely re-generate any and all pact files.
The text was updated successfully, but these errors were encountered:
The code that is writing the file is the Pact Mock Server which is brought in as an external dependency (Pact Mock Server). Already reached out to pinpoint where the issue occurs.
An option would be to either forcefully clean any existing JSON files in the target folder before verifying any of the interactions;
Or maybe provide an optional flag to clean up the folder before running the tests.
surpher
changed the title
Update to a matcher doesn't result in the contract
Update to a matcher doesn't update in the contract
Jun 9, 2020
This might not be a bug but expected behaviour. If it is confirmed that it is working as expected, documentation will be updated accordingly and/or an alternative handling of this will be looked into in PactSwift.
Confirmed it is a bug in pact_mock_server (pact-foundation/pact-reference#77).
Bug should be fixed with your next build when git submodule update --init --recursive pulls the fixes done in pact-reference submodule.
🌎 Environment
master
branch💬 Description
When writing a pact test and describing a value in body using an updated matcher, the change to that matcher is not reflected in the pact file.
If the pact file is deleted before running updated again, then the update is reflected in the pact file.
🦶 Reproduction Steps
.willRespondWith(body:)
contains a matcher:cmd + U
"matchingRules"
object for:EachLike("https://someurl.com/entity/related", min: 1, max: 10)
cmd + U
min:
andmax:
for the provided matcher🤔 Expected Results
When changing the matcher, the changes should be reflected in the subsequent test runs, eg:
😲 Actual Results
The changes to
min:
andmax:
are not recorded and remain set tomax: 5
andmin: 0
⑂ Possible workaround(s)
Before running the tests again with the changes to any of the matchers (tested with changing a
SomethingLike()
toEqualTo()
), remove any existing pact files in order to completely re-generate any and all pact files.The text was updated successfully, but these errors were encountered: