(opts: { dir?: string; body?: string; title?: string } = {})
| 31 | }); |
| 32 | |
| 33 | async function publishTestBoard(opts: { dir?: string; body?: string; title?: string } = {}) { |
| 34 | const dir = opts.dir ?? tmpDir; |
| 35 | const htmlPath = makeBoardHtml(dir, opts.body ?? "<p>Test</p>"); |
| 36 | const r = await fetchHandler( |
| 37 | req("POST", "/api/boards", { html: htmlPath, title: opts.title }), |
| 38 | ); |
| 39 | expect(r.status).toBe(200); |
| 40 | const body = (await r.json()) as { id: string; url: string; sourceDir: string }; |
| 41 | return { ...body, htmlPath, dir }; |
| 42 | } |
| 43 | |
| 44 | // ─── /health ───────────────────────────────────────────────────── |
| 45 |
no test coverage detected