Alex Maiburg
01/23/2024, 9:46 AMYousaf Nabi (pactflow.io)
Nuno Domingues
01/23/2024, 10:00 PMMatt (pactflow.io / pact-js / pact-go)
Is anybody here who could point me into a direction where I could see a working example installation of Angular, running jest and karma in parallel, because there are so many different possibilities of how you setup and write the test (e. g. jest-pact with pactWith).I can’t really comment on how to run jest and karma side by side, I can’t see why they’d naturally conflict if they run in separate processes. I would steer away from
jest-pact
/ pactWith
because that was aimed at solving a problem that’s now less of a problem, so vanilla @pact-foundation/pact
is probably sufficient.
If you could share the errors you are having (failing pact tests with debug logs) then we could probably point you in the right directionAlex Maiburg
01/25/2024, 8:46 AMprovider.addInteraction(...)
or change the interaction object the test is still green.
2. The interaction object defines only the content of the generated pact file? It doesn’t get tested in provider.executeTest(...)
in any wayMatt (pactflow.io / pact-js / pact-go)
executeTest
should check that the interaction you setup worked as expected, and serialise the interaction to the pact file (appending to any existing interactions in that file)Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
executeTest
? this isn’t doing what you think it isMatt (pactflow.io / pact-js / pact-go)
executeTest
(found on your provider
variable)
2. Call executeTest
. This takes a callback where your unit test takes place. Each test gets its own dedicated mock service (so you can run in parallel if you wish) and you must call the interaction you setup in the addInteraction
call, else the test will fail
a. This is when the pact file is written toAlex Maiburg
01/31/2024, 8:46 AMMatt (pactflow.io / pact-js / pact-go)