Contract Testing Demo using NodeJs, PactJs and Jest
npm run test:consumer
- consumer testnpm run test:provider
- provider testnpm run publish:contract
- publish contract to your pact broker
- For more info refer to https://github.com/pact-foundation/pact_broker (To have a play around on your local machine)
- Run
git clone git@github.com:pact-foundation/pact_broker.git
&&cd pact_broker/example
- Run
bundle install
- Run
bundle exec rackup -p 8080
- Isolate tests
- Avoid tests with UI integration
- Keep contracts up to date in your pact broker
- Test Coverage with Pact
- Use models carefully
- Use
debug
for logLevel for analysing test results'logLevel': 'debug'