Hi all, I am trying to reproduce the example from ...
# pact-js
з
Hi all, I am trying to reproduce the example from the courses https://testautomationu.applitools.com/pact-contract-tests I have written tests for the Consumer, but they are failed with errors Could you please help me how to fix it? I do not understand, how to debug them
b
I've never seen this course material, and it has some dubious standards/practices. Nevertheless . . . "Chapter 2 - setting up Pact" should be setting the
global.provider
up, so it works in the tests. The error "The pact mock server wasn't configured when addInteraction was called" is a hint that it might not be set up. The rest of the warnings also hint that the mock server has failed to start up.
Not sure if any of the maintainers are familiar with this content, but they might have more specific advice.
r
I remember trying this course too, but had the same issues and were not able to fix them 🤷 then I switched to a bit different approach and set up a provider in the same test file instead of globally setting it. Something like in this example https://www.npmjs.com/package/@pact-foundation/pact-web/v/8.1.0#example
🙏 1