import { describe, expect, it } from "vitest"; import { formatDocsLink } from "./links.js";
describe("formatDocsLink", () => {
it("prepends the docs root when given a relative path", () => { const out = formatDocsLink("/channels/quietchat", "quietchat");
expect(out).toContain("https://docs.openclaw.ai/channels/quietchat");
});
it("treats whitespace-only path like an empty path and falls back to docs root", () => { const out = formatDocsLink(" ", "root");
expect(out).toContain("https://docs.openclaw.ai");
});
it("does not crash when path is undefined (regression: #67076, #67074)", () => {
expect(() => formatDocsLink(undefined as unknown as string, "label")).not.toThrow(); const out = formatDocsLink(undefined as unknown as string, "label");
expect(out).toContain("https://docs.openclaw.ai");
});
it("does not crash when path is null", () => {
expect(() => formatDocsLink(null as unknown as string)).not.toThrow();
});
});
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.1 Sekunden
(vorverarbeitet am 2026-05-26)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.