Queue a response for the given POST path (FIFO).
(path: string, response: FakeResponse)
| 75 | |
| 76 | /** Queue a response for the given POST path (FIFO). */ |
| 77 | enqueue(path: string, response: FakeResponse): void { |
| 78 | const key = `POST ${path}`; |
| 79 | const list = this.responses.get(key) ?? []; |
| 80 | list.push(response); |
| 81 | this.responses.set(key, list); |
| 82 | } |
| 83 | |
| 84 | private handle(req: IncomingMessage, res: ServerResponse): void { |
| 85 | const chunks: Buffer[] = []; |