(
req: http.IncomingMessage,
res: http.ServerResponse,
// aimock strips the mount prefix — pathname will be "/" for an exact match.
pathname: string,
)
| 140 | function grokTTSMount(): Mountable { |
| 141 | return { |
| 142 | async handleRequest( |
| 143 | req: http.IncomingMessage, |
| 144 | res: http.ServerResponse, |
| 145 | // aimock strips the mount prefix — pathname will be "/" for an exact match. |
| 146 | pathname: string, |
| 147 | ): Promise<boolean> { |
| 148 | if (pathname !== '/' || req.method !== 'POST') return false |
| 149 | // Drain the request body (we don't need to inspect it for tests). |
| 150 | await drainBody(req) |
| 151 | res.statusCode = 200 |
| 152 | res.setHeader('Content-Type', 'audio/mpeg') |
| 153 | res.setHeader('Content-Length', String(FAKE_MP3_BYTES.length)) |
| 154 | res.end(FAKE_MP3_BYTES) |
| 155 | return true |
| 156 | }, |
| 157 | } |
| 158 | } |
| 159 |
nothing calls this directly
no test coverage detected