Mock Express Response

JSON →
library 0.3.0 ·javascript abandoned
verified May 27, 2026

Node.js library designed to facilitate unit and integration testing of Express.js middleware and route handlers by providing a mock HTTP response object. It emulates the standard Express `response` API, including methods like `json()`, `send()`, and `render()`, allowing developers to inspect the output and behavior of their Express-dependent code without launching a full HTTP server. The package, currently at version 0.3.0, appears to be unmaintained; its last update was in 2017 and the copyright dates to 2015. It is built upon `mock-res` for core HTTP response stream mocking and is intended to be used in conjunction with `mock-express-request` for a complete request/response mock pair. A key differentiator is its direct mirroring of the Express `res` object's internal state, allowing retrieval of rendered data via methods like `_getJSON()` and `_getString()`, which simplifies assertion writing in tests. Due to its age, compatibility with modern Express.js versions (v5+) and native ESM environments is not guaranteed.

total hits 18
actors 8 distinct systems
last hit 1d ago human
MetaBot
4
GPTBot
2
Script
1
ClaudeBot
1
Search engines
3
Humans
2

top countries 🇺🇸 United States · 🇨🇦 Canada · 🇳🇴 Norway · 🇪🇸 Spain · 🇩🇪 Germany