Keploy as a Node.js testing framework
Keploy tests Node.js services by recording real HTTP requests and every downstream call they trigger, then replaying both as assertions. There are no nock interceptors to register, no jest.mock factories to maintain, and no in-memory database to seed before a test runs.
keploy record -c "npm start"What Keploy gives a Node.js team
Any Node service, unchanged
Keploy wraps your start script. Express, Fastify, NestJS, Koa, and Hapi all record identically, and TypeScript is irrelevant to capture because Keploy records the running process rather than your source.
- Node 16 and above, CJS or ESM
- No exported app object required
- TypeScript needs no extra setup
- Full middleware stack executes
Why Node.js integration tests slow teams down
The friction is rarely the assertions. It is everything around them — spinning up dependencies, keeping mocks honest, and repairing tests after every refactor.
Testing Node.js: by hand, with Jest + nock + supertest, or with Keploy
Every nock interceptor and module mock is a hand-written copy of a contract you do not own. Keploy records the real response, so re-recording refreshes all of them at once.
Select any row for the full comparison, with code.
What you write for Node.js vs what Keploy records
All three produce the same assertion. Only the third still passes after the next refactor without anyone editing it.
Two stub objects exist only for this file, and both hard-code a shape that nothing verifies against the real Mongo document or Stripe response.
Three libraries, a downloaded mongod binary, and a seed step — and the Stripe body is still a hand-typed literal nobody re-checks.
The Mongo document and the Stripe response are recorded from the real dependencies. Re-recording after an upstream change updates both automatically.
Times are estimates for authoring one endpoint’s coverage from scratch, not measurements.
Node.js testing tools, compared
The options a team on Node.js actually reaches for, and where each one genuinely wins. Select a row for the full comparison.
Assessments reflect each tool’s documented behaviour, not benchmark measurements.
Record your Node.js app once, replay it forever
Keploy sits below your Node.js process at the network layer. It watches the calls your app already makes, then serves them back on replay so tests run with no dependencies attached.
Keploy records a GET call to /api/v1/orders/{id} on a Node.js service and captures the dependency calls it makes.
What Keploy mocks for Node.js, with zero config
7 of the 8 dependencies a typical Node.js service talks to are stubbed from the recording itself — no mock classes, no fixture files, no containers in CI.
- Auto-mocked
MongoDBView page
Wire protocol under mongoose and the Mongo driver
- Auto-mocked
PostgreSQLView page
Postgres protocol under node-postgres and Prisma
- Auto-mocked
MySQLView page
MySQL protocol under mysql2 and Sequelize
- Auto-mocked
RedisView page
RESP under ioredis and node-redis
- Auto-mocked
Apache KafkaView page
Kafka protocol under kafkajs
- Auto-mocked
gRPCView page
HTTP/2 framed calls from @grpc/grpc-js
- Outbound HTTPAuto-mocked
Outbound HTTP
Any axios, undici, fetch, or got call
- Partial
Amazon S3
S3 REST API via aws-sdk v3
Your first Node.js test suite in under five minutes
Every command below runs against your existing Node.js service. Nothing in your source tree changes.
1Install the Keploy CLI
A standalone binary — not an npm package, so package.json and your lockfile stay untouched.
curl -sSL https://keploy.io/install.sh | bash2Record your service
Hand Keploy the start script you already use. It runs the process and watches every socket it opens.
keploy record -c "npm start"3Exercise your routes
curl, Postman, your frontend, or an existing smoke script. Each request becomes a test case with its mocks attached.
curl -X POST localhost:3000/orders/ord_1/confirm -H 'Content-Type: application/json' -d '{"paymentToken":"tok_123"}'4Replay in CI
Replay serves recorded dependency responses, so no Mongo service or memory server is needed in the runner.
keploy test -c "npm start" --delay 10
Ready to try it on your own Node.js service?
Works with the rest of your Node.js stack
Keploy records at the network layer, so framework and driver choices inside your Node.js app do not change how it captures traffic.
Express
Recorded through the HTTP server — middleware order is irrelevant.
NestJS
Wrap nest start; providers and modules need no test doubles.
Fastify
Same capture path as Express; plugins do not affect recording.
Prisma
Queries are captured as the Postgres or MySQL protocol they emit.
Mongoose
Recorded as MongoDB wire traffic, not as model method calls.
TypeScript
Nothing to type. Keploy records the running process, not the source.
Testing the rest of your stack
- Frameworks
Keploy as a Express testing framework
Test the whole middleware chain, not a hand-built app instance — Keploy records real requests through your Express router and replays them.
Read the guide - Databases
Keploy as a MongoDB testing framework
Mock MongoDB at the wire protocol — real documents, real BSON types, real aggregation results — without a mongod binary in CI.
Read the guide - Databases
Keploy as a PostgreSQL testing framework
Record the Postgres frontend/backend protocol once and replay real result sets in tests — no container, no pg-mem, no schema to rebuild.
Read the guide - Caches & Stores
Keploy as a Redis testing framework
Record RESP traffic once and replay real cache hits, misses, TTLs, and pipeline responses without a Redis server in CI.
Read the guide - Message Queues
Keploy as a Apache Kafka testing framework
Test producers and consumers against recorded broker exchanges — no embedded Kafka, no Testcontainers cluster, no flaky poll loops.
Read the guide - Cloud & Infra
Keploy as a gRPC testing framework
Record real gRPC exchanges over HTTP/2 and replay them as tests — no in-process stub server, no hand-written mock service implementation.
Read the guide
Join our GlobalCommunity
Connect with developers worldwide. Follow updates, ask questions, share feedback, and ship faster with other Keploy builders.
“Best report of integration and API tests I've seen — which we don't get from RestAssured.”
G2“Future of microservices testing. I don't write tests now!”
G2 · 5/5“An amazing product that simplifies the automation.”
Gartner · 4.0