<!-- automd:badges color=yellow -->
npm install node-mock-http

Node.js http.IncomingMessage and http.ServerResponse mocked implementations that allows emulate calling Node.js http handlers. (based on unjs/unenv v1).
> [!NOTE]
> Documentation is incomplete!
``js
import { fetchNodeRequestHandler } from "node-mock-http";
const nodeHandler = (req, res) => {
res.end("OK!");
};
const res = await fetchNodeRequestHandler(
nodeHandler,
"http://example.com/test",
);
`
- Clone this repository
- Install latest LTS version of Node.js
- Enable Corepack using corepack enablepnpm install
- Install dependencies using pnpm build --stub
- Build project in stub mode using pnpm dev`
- Run interactive tests using
Published under the MIT license.
Made by community 💛
---
_🤖 auto updated with automd_