Spracherkennung für: .ts vermutete Sprache: Unknown {[0] [0] [0]} [Methode: Schwerpunktbildung, einfache Gewichte, sechs Dimensionen]
import { describe, expect, it } from "vitest";
import { stripStructuralPrefixes } from "./mentions.js";
describe("stripStructuralPrefixes", () => {
it("returns empty string for undefined input at runtime", () => {
expect(stripStructuralPrefixes(undefined as unknown as string)).toBe("");
});
it("returns empty string for empty input", () => {
expect(stripStructuralPrefixes("")).toBe("");
});
it("strips sender prefix labels", () => {
expect(stripStructuralPrefixes("John: hello")).toBe("hello");
});
it("passes through plain text", () => {
expect(stripStructuralPrefixes("just a message")).toBe("just a message");
});
it("flattens multiline soft reset commands before downstream parsing", () => {
expect(stripStructuralPrefixes("/reset soft\nre-read persona files")).toBe(
"/reset soft re-read persona files",
);
expect(stripStructuralPrefixes("/reset \nsoft")).toBe("/reset soft");
});
});
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet am 2026-04-27)
¤
*© Formatika GbR, Deutschland