Hi folks! Very new to Pact here, coming mainly fr...
# pact-js
l
Hi folks! Very new to Pact here, coming mainly from e2e testing with Cypress. I'm having some difficulty in transitioning from the 'Getting Started' workshop to actually getting started in my repo. My question (and I feel dumb even asking): what's the bare minimum command I'd need to run a pact consumer test in my CLI, after installing with something like npm/yarn? Most of the examples in the Pact docs have references to mocha, react-scripts, jest, etc, and I'm trying to figure out what is and isn't necessary. Ideally I'm thinking there must be something like
yarn run pact --spec product.pact.test.js --prefix consumer
Seems such an obvious one, but I've been looking through docs and examples for a lot of this afternoon
👋 1
y
you need a test runner for your language, jest, mocha etc are all examples. Cypress bundles mocha in a single package, (along with other stuff) ideally you need your code, and there should be some unit tests for that, somewhere in there they hopefully will be component integration tests which mock out a provider api. this is where you would use pact, to stand in for that provider mock.
react-scripts is used for create-react-app, a bundle of tools for building a react application, it includes jest as a test runner.
l
Ah! So it isn't a runner in itself. Now it makes a heap of sense! I can see some jest specs here and there in the team's repo, so I'll start from there. Thank you!
💯 1
y
Anytime my friend, and yep you got it. Any problems, just pop back up in here and we got you!
❤️ 2