Hi <#C9VBGLUM9|>, I'm new on using pact and I do h...
# pact-js
b
Hi #C9VBGLUM9, I'm new on using pact and I do have a doubt I'm not able to resolve by myself. Would it be this a right place to post my question?
I have already checked stackoverflow and the documentation. I have also asked chatgpt for some help but I still have a doubt.
1
Is it possible to create consumer pacts for multiple providers from a angular application using PactWeb? I've seen that this might be possible using Pact. I've also seen that PactWeb is an already removed feature, but the project I am currently working with is quite old and I inherited that behaviour. I've checked stackoverflow and it only mentions that Pact and PactWeb difference is that PactWeb allows to work in non-node based environments. I have tried to find some extra info in old versions but I couldn't. I've also tried asking chat GPT and I got the following answer, although I could not get the source of such affirmation.
Copy code
I apologize for any confusion earlier. PactWeb, the JavaScript library for Pact, is primarily designed for consumers to define and verify contracts with a single provider at a time. However, you can work around this limitation by creating separate Pact instances for each provider you want to interact with.
m
The answer should be yes. You would just need to create a separate
PactWeb
instance for each provider and create a separate mock server for each one outside of the angular process
t
Also note that pact web is deprecated, and not the recommended way to use pact
It's better to do your contract tests separately from the browser
PactWeb, the JavaScript library for Pact, is primarily designed for consumers to define and verify contracts with a single provider at a time.
This is almost, but not quite, entirely unhelpful. I wouldn't recommend asking GPT for anything to do with pact
☝️ 1
😁 1
b
Thank you so much for your answers!! It is crystal clear now to me. ❤️
🙌 1