MCPcopy Create free account
hub / github.com/Markonis/hndl / createMockResponse

Function createMockResponse

tests/service.ts:7–23  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5import { Readable } from "stream";
6
7const createMockResponse = () => {
8 const result: any = {};
9 return {
10 response: () => result as Response,
11 writeHead: (
12 code: number,
13 phrase: string,
14 headers: Record<string, string>,
15 ) => {
16 result.status = { code, phrase };
17 result.headers = headers;
18 },
19 end: (body: any) => {
20 result.body = body;
21 },
22 };
23};
24
25export const serviceTests = async () => {
26 {

Callers 1

serviceTestsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected