MCPcopy
hub / github.com/garrytan/gstack / publishTestBoard

Function publishTestBoard

design/test/daemon.test.ts:33–42  ·  view source on GitHub ↗
(opts: { dir?: string; body?: string; title?: string } = {})

Source from the content-addressed store, hash-verified

31});
32
33async 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

Callers 1

daemon.test.tsFile · 0.85

Calls 3

makeBoardHtmlFunction · 0.90
fetchHandlerFunction · 0.90
reqFunction · 0.90

Tested by

no test coverage detected