Open sourceActive

Pact

Pact is a contract testing tool that enables consumer-driven contract testing, allowing teams to test integrations without deploying the full stack.

Open source page ↗

Field note

What it does

Pact is a contract testing tool that enables consumer-driven contract testing, allowing teams to test integrations without deploying the full stack.

Capabilities

Available capabilities

Tags

Tags

Ways to use it

Ways to use it

sdk

JavaScript / @pact-foundation/pact

cli

Not filed / https://docs.pact.io/implementation_guides/overview

cli

Not filed / https://docs.pact.io/implementation_guides/overview

docker

Not filed / https://docs.pact.io/implementation_guides/overview

Product features

Product features

Consumer-Driven Contracts

Pact allows consumers to define expected interactions, driving provider features.

Writing Consumer Tests

Guidance on writing consumer tests, including best practices and rules.

Consumer Testing

Write unit tests for your client class to verify request creation and response handling.

Contract Sharing

Share the generated pact files with the provider team.

HTTP Support

Supports HTTP-based interactions.

Interaction Testing

Tests each interaction independently using a mock provider.

JVM implementation

pact-jvm project for Java microservices.

Matchers

Use matchers to reduce test fragility.

Message Support

Supports message-based interactions for queues.

Multi-language Support

A compatible Pact implementation in all commonly used languages.

Non-HTTP Testing

Pact can generate contracts for non-HTTP communications, like message queues.

Open Source

Pact is open source and welcomes contributions.

Pact Broker

Pact File Generation

Generates pact files after consumer tests pass.

Pact specification

Formats v2, v3, v4 support multiple provider states, messaging, and generators.

Provider State Setup

Allows setting up provider state before verification.

Provider States

Use provider states for clarity and maintainability.

Provider Verification

Run provider tests to verify that the provider meets the contract.

Ruby implementation

Original implementation in Ruby, used as a standalone executable.

Rust reference implementation

New reference implementation in Rust, wrapped by client languages via FFI.

Verification

Pact verifies that provider responses match the expected contract.