pact-foundation / jest-pact

A Pact adaptor for to allow you to easily run tests with Jest
https://pact.io
MIT License
80 stars 12 forks source link

Pact V3 support #199

Closed brendan-donegan closed 1 year ago

brendan-donegan commented 3 years ago

Hi,

We are using jest-pact in our project and would like to leverage some of the new features in Pact v3. I was wondering if/when v3 support could be added in jest-pact?

TimothyJones commented 3 years ago

Thanks for raising this! This has been asked before (although not tracked here) on https://github.com/pact-foundation/pact-js/issues/483 .

At the time, my thinking was we'd add it when the V3 branch is ready for production use, but I feel like more and more people are using V3 now.

I think it might be better to support it, and instead chase down the remaining issues that prevent V3 being recommended for production.

TimothyJones commented 3 years ago

Update: I've published a draft of a V3 compatible jest-pact. You can pick it up at:

npm install --save-dev jest-pact@0.9.0-beta.v3

Unfortunately, the interface had to change a bit. You can see a usage example in the readme at:

https://github.com/pact-foundation/jest-pact/tree/pact-js-v3#pact-js-v3

I'm not certain about the interface yet, feedback very welcome.

TimothyJones commented 3 years ago

@brendan-donegan Did you try out the V3 pactWith? How did it go for you?

schowave commented 3 years ago

We are working with the 0.9.0-beta.v3 right now and it works very well in all of our contract cases. Thank you for suporting the V3 Specification. Do you think there will be a release with the v3 specification soon?

We had an issue after the release of 9.0.0 two days ago: While using the "^0.9.0-beta.v3" syntax, the package manager fetched the 9.0.0 instead of the current V3 beta. So we had to use the fixed version 0.9.0-beta.v3.

TimothyJones commented 3 years ago

Ah, yes, good point. I’d like to include both, but it’s a bit tricky before the beta pact-js branch is merged, because of the peer dependency.

We’re working on the V3 merge as the highest priority right now.

Sent from my mobile

On 10 May 2021, at 7:12 pm, schowave @.***> wrote:

 We are working with the 0.9.0-beta.v3 right now and it works very well. Thank you for suporting the V3 Specification. Do you think there will be a release with the v3 specification soon?

We had an issue after the release of 9.0.0 two days ago: While using the "^0.9.0-beta.v3" syntax, the package manager fetched the 9.0.0 instead of the current V3 beta. So we had to use the fixed version 0.9.0-beta.v3.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

schowave commented 3 years ago

Are there any Updates on the V3 merge?

TimothyJones commented 3 years ago

We have the provider since nearly done, but there's still work to do on the consumer side. You can follow along with the project here https://github.com/pact-foundation/pact-js/projects/3, or join us on slack if you would like to help out

TimothyJones commented 3 years ago

(I think Matt and I are working on it in pretty much all the spare time we have available for software dev)

YOU54F commented 2 years ago

Great stuff here @TimothyJones & @mefellows

How have people been finding the new interface?

mefellows commented 2 years ago

There are still some minor teething issues/bugs to sort out in the main Pact JS project, and we currently don't have message support (see https://github.com/pact-foundation/pact-js/projects/3).

The JS core now has all of the requisite APIs for Pact JS, so it's just a public API implementation now mainly to go.

YOU54F commented 2 years ago

mainlined into master for jest-pact 0.10.1+ supporting pact-js 10.0.2+

TimothyJones commented 2 years ago

It is probably a good idea to release a 1.0 of jest pact soon

YOU54F commented 1 year ago

Will close this now, feedback can be provided in this issue

https://github.com/pact-foundation/jest-pact/issues/215

Thanks for everyones help