diff --git a/sdk/typescript/src/scan-dashboard.ts b/sdk/typescript/src/scan-dashboard.ts index 2f6a8cf3..ed1dae99 100644 --- a/sdk/typescript/src/scan-dashboard.ts +++ b/sdk/typescript/src/scan-dashboard.ts @@ -312,7 +312,9 @@ export class ScanDashboard { const files = this.#files === null ? "waiting for inventory" - : `${formatCount(this.#files.filesCompleted)} / ${formatCount(this.#files.filesTotal)} reviewed`; + : this.#files.filesCompleted > 0 + ? `${formatCount(this.#files.filesCompleted)} / ${formatCount(this.#files.filesTotal)} reviewed` + : `${formatCount(this.#files.filesTotal)} in scope`; const tokens = this.#cost === null ? "waiting for usage" diff --git a/sdk/typescript/tests-ts/scan-dashboard.test.ts b/sdk/typescript/tests-ts/scan-dashboard.test.ts index 012afc59..aa1e54ae 100644 --- a/sdk/typescript/tests-ts/scan-dashboard.test.ts +++ b/sdk/typescript/tests-ts/scan-dashboard.test.ts @@ -275,6 +275,11 @@ describe("live scan dashboard", () => { output_tokens: 236, }).cost!, ); + dashboard.setFiles({ + phase: "discovery", + filesCompleted: 3, + filesTotal: 1_258, + }); dashboard.stop(); const text = stripVTControlCharacters(stderr.text()); @@ -290,7 +295,9 @@ describe("live scan dashboard", () => { expect(text).toContain(" routes/login.ts"); expect(text).not.toContain("[09:41:19] routes/login.ts"); expect(text).toContain("routes/login.ts"); - expect(text).toContain("0 / 1,258 reviewed"); + expect(text).toContain("1,258 in scope"); + expect(text).not.toContain("0 / 1,258 reviewed"); + expect(text).toContain("3 / 1,258 reviewed"); expect(text).not.toContain("opened"); expect(text).not.toContain("3 / 6 active"); expect(text).toContain("17,985 in · 10,496 cached · 236 out");