Description
PactumJS is a REST API testing tool meant to cover every level of a test pyramid. It is used to write end-to-end, integration, component and contract tests against HTTP APIs, and the same descriptive style works at each level. Tests are built from chained methods that describe the request and the expected response, which keeps them easy to read. It runs with Mocha, and a Cucumber integration is documented in a separate boilerplate project. PactumJS can also act as a standalone mock server over HTTP or HTTPS, simulating any HTTP-based API such as a REST endpoint, and it can generate contracts for contract testing. The project describes itself as swift, lightweight and extendable, with its own helpers for managing test data. It was inspired by the Frisby and Pact projects. Full documentation is on the project website, and questions go through GitHub Discussions on the repository.…
Highlights
- Tests for e2e, integration, component and contract levels of an API
- Descriptive chained methods for requests and expectations
- Standalone mock server over HTTP or HTTPS
- Works with Mocha, and with Cucumber through a boilerplate
- Built-in data management for test values
- Extendable and customizable
Ratings & Reviews
No ratings yet
Be the first to rate Pactum.
People also visit
Pactum FAQ
What is PactumJS used for?
Automating REST API tests at every level of a test pyramid: end-to-end, integration, component and contract tests, plus mocking HTTP services.
Can it run as a mock server?
Yes. PactumJS can run as a standalone mock server over HTTP or HTTPS, simulating an HTTP-based API such as a REST endpoint. It can also generate contracts for contract testing.
Which test runners does it work with?
The readme shows examples with Mocha. Cucumber is supported through the separate pactum-cucumber-boilerplate project.
Is the source public?
Yes. The project is public on GitHub, where the readme and examples live.
Where can I learn more or ask questions?
Full documentation is at pactumjs.github.io. Questions and feedback go through GitHub Discussions on the repository.
What are the best Pactum alternatives?
Popular alternatives to Pactum include Puppetry, Just API and API Testing. See all Pactum alternatives

