Skip to content

An example of a consumer that uses Pact+Pactflow to create a consumer driven contract with its provider

Notifications You must be signed in to change notification settings

DomBarber/example-consumer

 
 

Repository files navigation

Example Consumer

Build Status

This is an example of a Node consumer using Pact to create a consumer driven contract, and sharing it via Pactflow.

It is using a public tenant on Pactflow, which you can access here using the credentials dXfltyFMgNOFZAxr8io9wJ37iUpY42M/O5AIZWxelWbLvqMd8PkAVycBJh2Psyg1. The latest version of the Example Consumer/Example Provider pact is published here.

The project uses a Makefile to simulate a very simple build pipeline with two stages - test and deploy.

  • Test
    • Run tests (including the pact tests that generate the contract)
    • Publish pacts, tagging the consumer version with the name of the current branch
  • Deploy (only from master)
    • Check if we are safe to deploy to prod (ie. has the pact content been successfully verified)
    • Deploy app (just pretend for the purposes of this example!)
    • Tag the deployed consumer version as 'prod'

Usage

See the Pactflow CI/CD Workshop.

About

An example of a consumer that uses Pact+Pactflow to create a consumer driven contract with its provider

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 77.6%
  • Makefile 17.0%
  • HTML 3.7%
  • CSS 1.7%