Replies: 7 comments 5 replies
-
Hi @mefellows! I was wondering about "Implement provider state parameters (#372)". The box is checked but I'm unable to find the code anywhere. In #372 you mentioned that you wanted to create a separate issue to track that but I was unable to locate this one as well. What I wanted to do is to formulate a contract that has multiple provider states so I can compose them as outlined in https://github.com/pact-foundation/pact-specification/tree/version-3#allow-multiple-provider-states-with-parameters: Is it correct that this is not supported in the current v3 branch? Edit: I can get this to work even with the current latest (non-beta) version by ignoring TypeScript and passing an array instead of a string: provider.addInteraction({
state: [
{'name': 'customer exists'},
{'name': 'user is logged in'}
],
...
}); |
Beta Was this translation helpful? Give feedback.
-
The above list is a bit of a WP a checklist for Ron and I when working through the new v3 (native) branch: https://github.com/pact-foundation/pact-js/tree/feat/v3.0.0 The multiple/parameters are still TBC in the main version, but you can test it our in the beta v3 branch: see https://github.com/pact-foundation/pact-js/#pact-js-v3 It is functional and has some new powerful v3 features (+ XML support). Just note that there are still outstanding features required for it to be a production ready thing, but any feedback of course would be great. |
Beta Was this translation helpful? Give feedback.
-
Thanks @mefellows. I got what you are saying (read the README) but unfortunately I was not able to see this change in the beta version or even in the feat/v3.0.0 branch. So I was wondering if I was missing something. However, no worries, as I was able to work around that by simply putting the multiple states even in the existing version. |
Beta Was this translation helpful? Give feedback.
-
Yes, it "sort of" works by accident the way it is today (but you don't get parameters, although they may also accidentally work also. See #407) See this on the v3 branch https://github.com/pact-foundation/pact-js/blob/feat/v3.0.0/examples/v3/e2e/test/consumer.spec.js#L171-L172. You can pass in params too |
Beta Was this translation helpful? Give feedback.
-
I found the example you linked as well but when I look at the code (https://github.com/pact-foundation/pact-js/blob/feat/v3.0.0/src/dsl/interaction.ts#L54 and https://github.com/pact-foundation/pact-js/blob/feat/v3.0.0/src/dsl/interaction.ts#L38) I can't see how this is supposed to actually work. Am I looking at the right place? |
Beta Was this translation helpful? Give feedback.
-
That branch still contains both code bases - all of the V3 exports are in the When the v3 branch is released, it will still have backwards-compatible support for the previous versions, so we've ported the new stuff to a separate package. Hope that makes sense. |
Beta Was this translation helpful? Give feedback.
-
Hey @mefellows, thank you for your work on v3! Is there any approximate release date for this version? |
Beta Was this translation helpful? Give feedback.
-
Summary
This issue tracks the major changes required to get Pact JS to a full v3.0.0 specification support, including integration with the native pact-reference library.
Moving to the native library will solve a number of pre-existing issues, as well as bring a number of positive new changes to the environment:
Current Status
Beta (see "beta" tag https://www.npmjs.com/package/@pact-foundation/pact)
See https://github.com/pact-foundation/pact-js#pact-js-v3 for examples on how to use the package.
Feature Overview: Specification Version 3.0
(see https://github.com/pact-foundation/pact-js/tree/feat/v3.0.0 for current implementation, what is documented below is the known delta).
Consumer Side
Windows 32bit supportProvider Side
Rust integration activities
Release Activities
Pact Broker Integration
Miscellaneous
Pact Web Support
The current way of running Pact with Rust will not work - we may need to look at WebAssembly or another alternative for this.
Beta Was this translation helpful? Give feedback.
All reactions