Hello all, I'm back on pact since I develop an app...
# pact-js
c
Hello all, I'm back on pact since I develop an app with a front end in JS and a backend in Rust. Last time I used Pact, it was the 9.x version. Today I'm on the 10.x version, but I don't see any JS script that I can run like before (eg.
pact-broker
) Is there a way to launch
can-i-deploy
and
publish
pact task with npm / yarn / pnpm nowadays ?? Or do I need to go with another (or a better) option ??
Is the docker CLI is the recommended way to publish and check if I can deploy ? Should I have to go back to 9.x to be able to publish & check deployment with pnpm ??
t
I’m pretty sure that pact-broker is still shipped with 10.x.
What problem are you encountering when you try to run it?
Is the docker CLI is the recommended way to publish and check if I can deploy ?
I don’t think so.
I think it’s better to use the CLI directly in your scripts
c
well i tried
pnpm pact-broker
and I got an error
@Timothy Jones Here is the error
And when I look into the
node_modules/.bin
folder, i don't see any pact-broker binaries
Here is the folder, that should contain the pact-broker binary. As you can see, it doesn't include that pact binaries, even so, i installed the 10.x version of pact. Is it a problem with pnpm ?
Ok the problem is that the install script for pact errored
Here is my
.npmrc
.npmrc.yaml
For info, i fixed the previous error by installing
node-gyp
as global package. But I still don't have the
pact-broker
binary 😢
Ok event so with pact 9.x, the binaries are not installed, maybe the problem comes from pnpm. Can you tried to install pact with pnpm ? In my previous project, I was using yarn
t
It’s probably pnpm
The binstubs are installed transitively from the pact code dependency
*core
Try installing @pact-foundation/pact-core directly
🌮 1
c
ok, it fixed the problem 🙂 thx you a lot !!!
t
You’re welcome. I don’t know why npnm and yarn like to change the install behaviour, but they do, and it’s annoying for people who want to make libraries that work 🤷‍♂️
this 1
👍 1
💯 1
c
haha don't worry, pact is a de facto choice for my test strategy 🙂 (I'm using clean / hexa architecture) In frontend world, it goes this way • First some unit test for my business logic with in-memory adapters • Then contract testing with pact for my real adapters • Finally some ui test with playwright or cypress In backend world: • Unit test for my domain logic with in-memory adapters • Integration testing for my real adapters with some containers • And finally contract testing for my primary adapters (before pact, it was End-To-End)
❤️ 3
y
Nice @Carere and welcome back 👋