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!
import { fetchNodeRequestHandler } from "node-mock-http";
const nodeHandler = (req, res) => {
res.end("OK!");
};
const res = await fetchNodeRequestHandler(
nodeHandler,
"http://example.com/test",
);
local development
Published under the MIT license.
Made by community 💛
🤖 auto updated with automd