/pact-testing-example

Example of using Pact Js for contract driven tests of a simple react application

Primary LanguageJavaScriptMIT LicenseMIT

pact-testing-example

Build Status

An example React app with component integration tests that demonstrate Consumer Driven Contract in practice.

This example uses the following stack for testing:

  • PactJS - A JavaScript implementation of the Pact spec that is used with the tests to guarantee that contract dependencies are satisfied
  • Cucumber.js - Testing interface that allows us to write plain English tests specs in Gherkin
  • WebdriverIO - Test runner abstraction on top of Selenium that allows us to write integration tests via the browser

Getting Started

Installing

Using npm with:

npm install

Development

npm start

This should compile the project and start a webpack server with the hot reload module on http://localhost:3000.

Tests

Run the integration testsuite by:

npm run integration-test

Credits