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>
This commit is contained in:
19
deps/db-sync/worker/api_docs_test.mjs
vendored
Normal file
19
deps/db-sync/worker/api_docs_test.mjs
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
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);
|
||||
});
|
||||
Reference in New Issue
Block a user