Files
Synapse/deps/db-sync/worker/api_docs_test.mjs
Dasemu 40631362b3 Initial import of LogDarioSeq baseline
Establishes version control for the personal Logseq DB fork before
starting the server-client architecture migration and domain features
described in docs/agent-guide and the approved implementation plan.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-25 15:32:15 +02:00

20 lines
678 B
JavaScript

import assert from "node:assert/strict";
import test from "node:test";
import { apiDocsResponse } from "./api_docs.mjs";
test("API docs are served as standalone HTML from both docs paths", async () => {
const html = "<!doctype html><title>Logseq Server API</title>";
for (const path of ["/api-docs", "/api-docs/"]) {
const response = apiDocsResponse(path, html);
assert.equal(response.status, 200);
assert.equal(response.headers.get("content-type"), "text/html; charset=utf-8");
assert.equal(await response.text(), html);
}
});
test("API docs helper ignores unrelated paths", () => {
assert.equal(apiDocsResponse("/openapi.json", "docs"), null);
});