import { describe, expect, it } from "vitest"; import { scanDigest } from "./scanner.service.js"; describe("scan digest", () => { it("reports incomplete files without exposing huge traces", () => { const detail = scanDigest( 19, 0, [ { filePath: "/library/broken.cbr", error: "x".repeat(300) }, { filePath: "/library/broken.epub", error: "Invalid EPUB" } ] ); expect(detail).toContain("Scanned 19 file(s)"); expect(detail).toContain("2 incomplete file(s)"); expect(detail).toContain("broken.cbr"); expect(detail.length).toBeLessThan(380); }); });