
PactumJS Review
- MIT license
- Free to use forever
- API testing tool with contract testing
- Self-hosted flow server
- Community-maintained
- No licensing costs
- No paid tier or subscription
- Bidirectional contract testing
- Built-in mock server
- Repository created in 2019
- Created by Anudeep (ASaiAnudeep)
- Small-team community project
- 600+ GitHub stars
Overview
PactumJS is a free, open-source REST API testing tool for Node.js that covers end-to-end, integration, component, and contract testing. Its primary use is API testing, with fluent request building, expressive assertions, a built-in mock server, and data management. It was created in 2019 by Anudeep, is MIT licensed, and the current release is version 3.9.1 from February 2026. It is not a test runner itself, so it runs alongside Mocha, Jest, Jasmine, or Cucumber.
For contract testing, PactumJS uses its own bidirectional model that it explicitly states is not Pact-compatible. Rather than writing consumer-driven pacts, it converts existing component and integration tests into recorded interactions. Consumers publish their assumed behavior as interactions, providers publish their actual behavior as flows, and a self-hosted Docker-based flow server compares them and produces a compatibility matrix. So contract testing is a secondary capability layered on its API-testing core, not consumer-driven contracts.
PactumJS is for Node.js teams already using it for API testing who want lightweight contract testing in the same tool without adopting Pact. It converts existing tests into flows through a plugin and centralizes them in the flow server. Buyers should note that it is JavaScript and Node.js only, that its contract testing is a non-standard model that is not interoperable with the Pact ecosystem, that the community is small, and that its contract testing is less proven than Pact or Spring Cloud Contract.
Key Featuresโ
Fluent API Testingโ
The spec chain builds requests across HTTP methods, headers, query, body, and path params, with expressive assertions. This is the primary use of the tool.
Expressive Assertionsโ
Assertions cover status, body, JSON match, schema, and headers, and are extendable. This validates responses in detail.
Retry and Waitโ
A built-in retry mechanism retries on failed expectations, similar to a fluent wait. This handles timing in integration flows.
Data Managementโ
Data templates, maps, functions, and stores capture and reuse values across tests. This threads data through end-to-end flows.
Built-in Mock Serverโ
A built-in mock server can run standalone, with interactions instructing it to simulate external services. This isolates the system under test.
Bidirectional Contract Testingโ
Contract testing uses a bidirectional model where consumers publish assumed behavior and providers publish actual behavior, compared by a flow server. This is its own approach, not Pact-style consumer-driven contracts.
Flow Serverโ
The self-hosted, Docker-based flow server stores flows and interactions, builds compatibility matrices, and adds quality gates. This centralizes contract results.
Test Conversionโ
Replacing spec with flow and adding the flow plugin turns existing tests into contract artifacts. This reuses tests rather than writing a separate suite.
Best Selling Pointsโ
- A capable Node.js API testing tool with contract testing built in.
- A bidirectional contract-testing model that reuses existing tests.
- A built-in mock server that can run standalone.
- Strong data management for end-to-end flows.
- Runs on top of any Node test runner.
- Free and open source under MIT.
Supported Integrationsโ
PactumJS runs with any Node test runner and adds reporters and the flow server.
Connect PactumJS across Node test runners, reporters, and the flow server.
- Mocha
- Jest
- Cucumber
- Mock server
- Flow server
- CI/CD
Test Runners
- Mocha
- Jest
- Jasmine
- Cucumber
Reporters
- pactum-json-reporter
- pactum-swagger-coverage
- pactum-influxdb-reporter
- pactum-flow-plugin
Contract Testing
- Flow server (Docker)
- Interactions
- Flows
- Compatibility matrix
Other
- Built-in mock server
- CI/CD via npm test
- Node.js 10+
Adoptersโ
PactumJS is a moderately popular Node.js API testing library, with smaller adoption for contract testing specifically.
- Node.js API teams
- JavaScript and TypeScript teams
- Integration and e2e testers
- Component-testing teams
- CI/CD pipelines
- Mock-server users
- Lightweight contract-testing teams
- Open-source projects
Adoption & Usage Statisticsโ
- 600+ GitHub stars
- ~74k weekly npm downloads
- ~24 contributors
- 3.9.1 current release as of February 2026
- 2019 repository created
- An API testing tool with secondary contract testing
Note: PactumJS is adopted within the Node.js community rather than rated on commercial review sites, and metrics are from GitHub and the npm registry.
Supported Platformsโ
PactumJS runs on Node.js and tests any service over HTTP, with the flow server in Docker.
PactumJS runs on Node.js, testing HTTP services, with a Docker flow server.
- Node.js 10+
- REST APIs
- Mock server
- Docker flow server
- Any Node runner
- HTTP and HTTPS
- Runtime: Node.js 10 and later, with tests in JavaScript or TypeScript.
- Targets: REST APIs over HTTP and HTTPS.
- Mock server: built in, able to run standalone.
- Flow server: self-hosted via Docker for contract testing.
Reportingโ
PactumJS reports through the test runner and pluggable reporters.
PactumJS reports through the runner and pluggable reporters.
Result Outputs
Runner output plus JSON, coverage, and flow reporters.
- JSONpactum-json-reporter output
- Swagger CoverageOpenAPI coverage reporter
- Flow PluginPublishes flows and interactions
- Runner OutputMocha, Jest, or Cucumber results
- JSON output comes from the pactum-json-reporter.
- Swagger coverage reports OpenAPI coverage.
- The flow plugin publishes flows and interactions for contract testing.
- Runner output comes from Mocha, Jest, or Cucumber.
Ecosystem & Extensionsโ
PactumJS is a single package with reporter and contract-testing plugins.
- The flow server and pactum-flow-plugin enable bidirectional contract testing.
- Reporter packages add JSON, Swagger coverage, and InfluxDB output.
- The built-in mock server simulates external services.
- Data management constructs are reused across tests and mocks.
Releases and Maintenanceโ
- Current release: PactumJS 3.9.1, published in February 2026.
- Cadence: regular releases, with the repository updated through 2026.
- Maintenance: a small-team community project led by Anudeep.
- Support: community support, with GitHub Sponsors for the author.
Pricingโ
- PactumJS is free and open source under the MIT license, with no paid tier or subscription.
- It is installed through npm as the pactum package.
- The flow server is self-hosted and open source, with no hosted commercial broker.
Awards & Recognitionโ
- PactumJS is a recognized Node.js API testing tool.
- It offers contract testing through its own bidirectional model.
- It is covered across JavaScript testing tutorials and guides.
- Recognition is adoption and community driven rather than through formal awards.
Limitationsโ
- It is JavaScript and Node.js only, with no other language consumers or providers.
- Contract testing is a secondary capability on a non-Pact bidirectional model.
- It is not interoperable with the Pact ecosystem or brokers.
- The community is small, largely around one lead maintainer.
- Its contract testing is less mature and proven than Pact or Spring Cloud Contract.
- It is not a test runner, so it requires Mocha, Jest, Jasmine, or Cucumber.
Best Fit Scenariosโ
- Node.js teams already using PactumJS for API testing.
- Teams that want lightweight contract testing without adopting Pact.
- All-JavaScript stacks where a non-Pact bidirectional model is acceptable.
- Projects reusing existing component tests as contract flows.
- Teams that want API testing and a mock server in one tool.
- Groups comfortable self-hosting the Docker flow server.