pmpact v0.4.6
pmpact
A command line tool to convert Pact files to Postman collections.
Contents
Requirements
Requires NodeJS version v20.11 or higher.
Installation
npm install -g pmpactInstallation from the repo
Clone the repo and from the root execute:
npm install
npm linkNote: Don't forget to run npm unlink if needed!
Command line usage
From a url
pmpact http://pact-broker/provider/a-provider/consumer/a-consumer/latestFrom a file
pmpact pact-file.jsonSave to a file
pmpact http://pact-broker/provider/a-provider/consumer/a-consumer/latest -o postman-collection.jsonFrom a url that requires headers
pmpact http://pact-broker/provider/a-provider/consumer/a-consumer/latest -H '{"Authorization":"Basic ZFhmbHR5Rk1n..."}'Postman usage
Import the collection in Postman
Once you have a generated Postman collection, select "import" in Postman. The generated collection format is 2.1.
A collection should appear, starting with the name "Pact".
Create a Postman environment
A url variable is used for all the requests. The next step is to create an Postman environment with a url variable, for example: url: http://my-service.com.
You're good to go - so make the requests!
Run tests
Run all tests
npm testRun unit tests only
npm run test-unitRun integration tests only
npm run test-integration### Watch tests
npm install -g nodemon
nodemon tests/unit -x "npm run test-unit"
nodemon tests/integration -x "npm run test-integration"License
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago