Kevin Grady
03/02/2023, 4:14 PM"metadata": {
"pactSpecification": {
"version": "2.0.0"
}
}
I somehow need to configure this version number to be version 3.0.0 to meet the requirements of the provider's contract. How can I configure this?Yousaf Nabi (pactflow.io)
Matt (pactflow.io / pact-js / pact-go)
Kevin Grady
03/03/2023, 7:21 PMWhen you say provider contract, what are you referring to?I’m referring to the platform APIs pact file that will be in contract with our Angular frontend pact file
which pact client libraryif you are referring to the node module, this is our dependency in package-lock.json:
"@pact-foundation/pact-node": "^10.17.2",
and npm ls shows both:
@pact_foundation_greet/pact@9.18.1 and jest-pact@0.9.4Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
I somehow need to configure this version number to be version 3.0.0 to meet the requirements of the provider’s contract. How can I configure this?what makes you think this is true? Are you seeing some error or problem?
Kevin Grady
03/07/2023, 4:18 PMKevin Grady
03/07/2023, 4:22 PMYousaf Nabi (pactflow.io)
2.0.0 spec file, and one generating a 3.0.0 file?
the issue is with the team verifying the contracts (provider side?)Kevin Grady
03/07/2023, 4:29 PMYousaf Nabi (pactflow.io)
Kevin Grady
03/07/2023, 4:35 PMYousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
PactV3 interface from pact-js
https://github.com/pact-foundation/pact-js/blob/master/docs/consumer.md#consumer-package
something like
const provider = new PactV3({
dir: path.resolve(process.cwd(), 'pacts'),
consumer: 'MyConsumer',
provider: 'MyProvider',
});
the Pact interface will provide up to v2.0.0 and remains for backwards compatability.
You will need pact-js v10+Kevin Grady
03/07/2023, 7:47 PMso a single consumer app, is generating two pact files, with two different specifications.The consumer app is only generating a single pact file that is spec version 2.0.0
is that causing an issue to your provider team for verifying? which language are they using to verify the pact filesProvider team is using .NET to verify. They are expecting spec version 3.0.0
Which language are you using to create the pact files? Pact-JS? IWe have
@pact_foundation/pact as a dependency and @jest/pact . Is pact-js a separate package?
Is one of the tests using the PactJS V3 interface (thusly generating v3 spec pact files)I’ve just upgraded to pact 11.0.0 so I can use the V3 interface. There seems to be a lot of differences I’m going over right now
Yousaf Nabi (pactflow.io)
Yes that seems strange. If a provider can support spec 3 pacts it can also verify a spec 2 pact.what is the issue the provider is seeing when attempting to verify your v2 pact.
Kevin Grady
03/07/2023, 8:18 PMwhat is the issue the provider is seeing when attempting to verify your v2 pactI’ll let you know and reach out ASAP. In the mean time, is there some documentation on how to work with V3? It seems I no longer have access to mockService, setup(), verify(), finalize() within a PactV3, and addInteraction takes different parameters
Kevin Grady
03/07/2023, 8:19 PMWe haveas a dependency and@pact_foundation/pact. Is@jest/pacta separate package?pact-js
Yousaf Nabi (pactflow.io)
@pact-foundation/pact
jest-pact is a convenience wrapper mainly to deal with the setup/teardown lifecycle methods that were required before when pact-js used a ruby core.
you pact use @pact-foundation/pact directly or use jest-pact on top.
migration guide for v3 format https://github.com/pact-foundation/pact-js/blob/master/docs/migrations/9-10.mdYousaf Nabi (pactflow.io)
Kevin Grady
03/20/2023, 7:02 PMthe mockService property on the Pact class is no longer an actual MockService, but supports the baseUrl property for compatibility.
But I am seeing an error that mockService is not a known property of PactV3Kevin Grady
03/20/2023, 7:21 PM