pact-foundation / pact-js

JS version of Pact. Pact is a contract testing framework for HTTP APIs and non-HTTP asynchronous messaging systems.
https://pact.io
Other
1.62k stars 343 forks source link

Add note about `uponReceiving` being unique to the migration notes + docs #1091

Open TimothyJones opened 1 year ago

TimothyJones commented 1 year ago

Since changing to the rust core, it is important that the value of uponReceiving is unique.

This is because (I believe) it uses that field to determine if the interaction should be updated or added to the pact file. I think the ruby core didn't do this (or used some other method to determine whether two interactions were the same).

This information should be:

1) In the migration guide 2) Called out in big letters in the documentation

mefellows commented 1 year ago

Thanks Tim. It was similar in the Ruby implementation, but I think it would just silently override the previous interaction. It should be the combination of description and state (and possible request details like path/verb). If not, that's a bug.

TimothyJones commented 1 year ago

For bonus points, Pact-JS could detect this case during the same test run and fail / warn (probably fail)

YOU54F commented 3 months ago

Should be fixed as part of https://github.com/pact-foundation/pact-reference/pull/437

which will come in lib_pactffi 0.4.21