diff --git a/src/output/debug.ts b/src/output/debug.ts index deb832b7..1479d2ea 100644 --- a/src/output/debug.ts +++ b/src/output/debug.ts @@ -6,6 +6,7 @@ export type DebugLogger = (message: string, details?: unknown) => void; export type DebugSession = { log: DebugLogger; announcePath: () => void; + close: () => void; }; export function createDebugLogger(enabled: boolean): DebugSession { @@ -13,6 +14,7 @@ export function createDebugLogger(enabled: boolean): DebugSession { return { log: () => {}, announcePath: () => {}, + close: () => {}, }; } @@ -35,7 +37,7 @@ export function createDebugLogger(enabled: boolean): DebugSession { console.error(`[debug] Writing debug log to ./${filename}`); }; - return { log, announcePath }; + return { log, announcePath, close: () => {} }; } function formatJson(details: unknown): string { diff --git a/tests/output.test.ts b/tests/output.test.ts index 63d8b8b2..76b6f4cf 100644 --- a/tests/output.test.ts +++ b/tests/output.test.ts @@ -160,6 +160,11 @@ describe("output formatters", () => { } }); + it("close is callable for enabled and disabled debug sessions", () => { + expect(createDebugLogger(false).close()).toBeUndefined(); + expect(createDebugLogger(true).close()).toBeUndefined(); + }); + it("formats empty hint lines as empty output", () => { expect(formatHintLines([])).toEqual([]); });