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

fix: support multiple states with same name #1168

Closed mefellows closed 8 months ago

mefellows commented 8 months ago

Fixes #848 using the new ffi_given_with_params core function.

Allows different parameters for the same state name to be reused, resulting in multiple provider states with the same description, but different parameters.

mefellows commented 8 months ago

Crap, the pactffi_given_with_params accepts 3 args not 4! I need to do the whole release shenanigans again :P

YOU54F commented 8 months ago

doh! I'll get on that today

YOU54F commented 8 months ago

Pact-js-core release sorted, and changes pulled into this branch from master, so should be good to go.

Would be good to include a test case that covers this, so we can say its definitely boxed off, maybe we can dust off a repro from the original issue

current ci failures unrelated to original issue, and I'll separately look into that

mefellows commented 8 months ago

Thanks, yes probably need a smoke test suite for the FFI functions in the core (to prevent that bad mapping). Ideally, they are auto generated - just needs some solid spiking time to generate a workable concept.

In Pact JS, the function will be used in lots of places so will get the coverage needed (I think).

As for the failing tests, strange they work on some OS/Arch combinations. Thanks for looking (and raising the upstream in pact reference).

YOU54F commented 8 months ago

windows currently skip the v4 matt plugin test as they were failing in ci (fine locally)

macos/linux covers them which is why are they are red, and the windows are green.

mefellows commented 8 months ago

Thank you sir!