# Pact JS

JavaScript consumer\-driven contract tests for HTTP and message\-based integrations\.

ID: Q194 · Revision: 178

Type: software · License: MIT[^pact-js-license] · Status: active

Website: https://docs.pact.io/implementation_guides/javascript/



Pact JS is the JavaScript implementation of Pact's consumer\-driven contract\-testing approach\. Consumer tests generate examples of expected interactions, which a provider verifies separately, helping teams detect incompatible request and response assumptions without exercising the whole distributed system together\.[^pact-js-readme][^pact-intro]

## Capabilities and substitutions

### Consumer\-driven contracts — supported

Actual consumer tests generate interactions for provider verification\.[^pact-intro][^pact-consumer]

Use case: Consumer/provider interface compatibility · Platforms: Node\.js 22\+ for inspected 17\.1\.4 · Region: Version, plan and platform requirements apply

### Message handler contracts — supported

Tests message contents while abstracting the transport intermediary\.[^pact-js-messages]

Use case: Consumer/provider interface compatibility · Platforms: Node\.js 22\+ for inspected 17\.1\.4 · Region: Version, plan and platform requirements apply

### Provider business side effects — unsupported

Contract verification does not establish functional side effects such as persistence\.[^pact-functional]

Use case: Consumer/provider interface compatibility · Platforms: Node\.js 22\+ for inspected 17\.1\.4 · Region: Version, plan and platform requirements apply

### [Substitute for Specmatic](/specmatic) — limited

Can replace interface\-compatibility testing with JavaScript consumer\-driven examples; schema\-driven coverage and artifacts differ\.[^pact-js-readme][^pact-intro][^specmatic-model]

Use case: Consumer/provider interface compatibility · Platforms: Node\.js 22\+ for inspected 17\.1\.4 · Region: Version, plan and platform requirements apply

## References

[^pact-js-license]: [Pact JS license](<https://github.com/pact-foundation/pact-js/blob/master/LICENSE>) — MIT license (vendor; retrieved 2026-10-07T11:14:41Z)

[^pact-js-readme]: [Pact JS repository](<https://github.com/pact-foundation/pact-js/blob/master/README.md>) — JavaScript contract testing and framework integration (vendor; retrieved 2026-10-07T11:14:26Z)

[^pact-intro]: [Pact introduction](<https://docs.pact.io/>) — Consumer\-driven contracts by example (vendor; retrieved 2026-10-07T11:14:10Z)

[^pact-consumer]: [Writing Pact consumer tests](<https://docs.pact.io/consumer>) — Exercise actual consumer logic rather than mock\-only calls (vendor; retrieved 2026-10-07T11:14:10Z)

[^pact-functional]: [Contract tests versus functional tests](<https://docs.pact.io/consumer/contract_tests_not_functional_tests>) — Message compatibility is not side\-effect verification (vendor; retrieved 2026-10-07T11:14:10Z)

[^pact-js-messages]: [Pact JS event\-driven systems](<https://docs.pact.io/implementation_guides/javascript/docs/messages>) — Message\-content abstraction and handler adapters (vendor; retrieved 2026-10-07T11:15:17Z)

[^pact-js-runtime]: [Pact JS package metadata](<https://github.com/pact-foundation/pact-js/blob/master/package.json>) — Version 17\.1\.4 engines\.node requires \>=22 (vendor; retrieved 2026-10-07T11:16:07Z)

[^pact-broker-intro]: [Pact Broker introduction](<https://docs.pact.io/pact_broker>) — Self\-hosted contract/result sharing versus managed PactFlow (vendor; retrieved 2026-10-07T11:14:10Z)

[^specmatic-model]: [Specmatic spec\-driven development](<https://docs.specmatic.io/contract_driven_development>) — Executable specifications and mock validation (vendor; retrieved 2026-10-07T11:14:19Z)

Source revision: https://substitutefor.net/entities/Q194?revision=178
