()
| 5 | import { Readable } from "stream"; |
| 6 | |
| 7 | const 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 | |
| 25 | export const serviceTests = async () => { |
| 26 | { |