mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-05 14:10:24 +00:00
refactor(deadcode): drop orphaned extension helpers
This commit is contained in:
@@ -2,15 +2,6 @@ import { mkdtemp, rm } from "node:fs/promises";
|
||||
import os from "node:os";
|
||||
import path from "node:path";
|
||||
import { afterEach, beforeAll, describe, expect, it, vi } from "vitest";
|
||||
import {
|
||||
escapeNextcloudTalkMarkdown,
|
||||
formatNextcloudTalkCodeBlock,
|
||||
formatNextcloudTalkInlineCode,
|
||||
formatNextcloudTalkMention,
|
||||
markdownToNextcloudTalk,
|
||||
stripNextcloudTalkFormatting,
|
||||
truncateNextcloudTalkText,
|
||||
} from "./format.js";
|
||||
import {
|
||||
looksLikeNextcloudTalkTargetId,
|
||||
normalizeNextcloudTalkMessagingTarget,
|
||||
@@ -73,30 +64,6 @@ async function makeTempDir(): Promise<string> {
|
||||
}
|
||||
|
||||
describe("nextcloud talk core", () => {
|
||||
it("accepts SecretRef botSecret and apiPassword at top-level", () => {
|
||||
expect(markdownToNextcloudTalk(" **hello** ")).toBe("**hello**");
|
||||
});
|
||||
|
||||
it("escapes markdown-sensitive characters", () => {
|
||||
expect(escapeNextcloudTalkMarkdown("*hello* [x](y)")).toBe("\\*hello\\* \\[x\\]\\(y\\)");
|
||||
});
|
||||
|
||||
it("formats mentions and code consistently", () => {
|
||||
expect(formatNextcloudTalkMention("@alice")).toBe("@alice");
|
||||
expect(formatNextcloudTalkMention("bob")).toBe("@bob");
|
||||
expect(formatNextcloudTalkCodeBlock("const x = 1;", "ts")).toBe("```ts\nconst x = 1;\n```");
|
||||
expect(formatNextcloudTalkInlineCode("x")).toBe("`x`");
|
||||
expect(formatNextcloudTalkInlineCode("x ` y")).toBe("`` x ` y ``");
|
||||
});
|
||||
|
||||
it("strips markdown formatting and truncates on word boundaries", () => {
|
||||
expect(stripNextcloudTalkFormatting("**bold** [link](https://example.com) `code`")).toBe(
|
||||
"bold link",
|
||||
);
|
||||
expect(truncateNextcloudTalkText("alpha beta gamma delta", 14)).toBe("alpha beta...");
|
||||
expect(truncateNextcloudTalkText("short", 14)).toBe("short");
|
||||
});
|
||||
|
||||
it("builds an outbound session route for normalized room targets", () => {
|
||||
const route = resolveNextcloudTalkOutboundSessionRoute({
|
||||
cfg: {},
|
||||
|
||||
Reference in New Issue
Block a user