import { describe, expect, it } from "vitest"; import type { TaskRecord } from "./task-registry.types.js"; import {
buildTaskStatusSnapshot,
formatTaskStatusDetail,
formatTaskStatusTitle,
sanitizeTaskStatusText,
} from "./task-status.js";
describe("task status formatting", () => {
it("truncates long task titles and details", () => { const task = makeTask({
task: "This is a deliberately long task prompt that should never be emitted in full because it may include internal instructions and file paths.",
progressSummary: "This progress detail is also intentionally long so the status line proves it truncates verbose task context instead of dumping a wall of text.",
});
expect(formatTaskStatusTitle(task)).toContain( "This is a deliberately long task prompt that should never be emitted in full",
);
expect(formatTaskStatusTitle(task).endsWith("…")).toBe(true);
expect(formatTaskStatusDetail(task)).toContain( "This progress detail is also intentionally long so the status line proves it truncates verbose task context",
);
expect(formatTaskStatusDetail(task)?.endsWith("…")).toBe(true);
});
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.