( proxy: ProxyHandle, path: string, body: unknown, timeoutMs?: number, )
| 375 | } |
| 376 | |
| 377 | async function postJson( |
| 378 | proxy: ProxyHandle, |
| 379 | path: string, |
| 380 | body: unknown, |
| 381 | timeoutMs?: number, |
| 382 | ): Promise<Response> { |
| 383 | return fetchWithTimeout( |
| 384 | `${proxy.baseUrl}${path}`, |
| 385 | { |
| 386 | method: "POST", |
| 387 | headers: { "Content-Type": "application/json" }, |
| 388 | body: JSON.stringify(body), |
| 389 | }, |
| 390 | timeoutMs, |
| 391 | ); |
| 392 | } |
| 393 | |
| 394 | async function runTest(name: string, fn: () => Promise<string | void>): Promise<boolean> { |
| 395 | process.stdout.write(` ${name} ... `); |
no test coverage detected