diff --git a/src/commands/status.update.test.ts b/src/commands/status.update.test.ts index 8c29a37839f..0ba0175058c 100644 --- a/src/commands/status.update.test.ts +++ b/src/commands/status.update.test.ts @@ -66,7 +66,7 @@ describe("resolveUpdateAvailability", () => { }); describe("formatUpdateOneLiner", () => { - it("renders git status and registry latest summary", () => { + it("renders git status and explicit up-to-date registry summary", () => { const update = buildUpdate({ installKind: "git", git: { @@ -90,7 +90,25 @@ describe("formatUpdateOneLiner", () => { }); expect(formatUpdateOneLiner(update)).toBe( - `Update: git main · ↔ origin/main · dirty · behind 2 · npm latest ${VERSION} · deps ok`, + `Update: git main · ↔ origin/main · dirty · behind 2 · up to date · npm latest ${VERSION} · deps ok`, + ); + }); + + it("renders package-manager mode with explicit up-to-date state", () => { + const update = buildUpdate({ + installKind: "package", + packageManager: "npm", + registry: { latestVersion: VERSION }, + deps: { + manager: "npm", + status: "ok", + lockfilePath: "package-lock.json", + markerPath: "node_modules", + }, + }); + + expect(formatUpdateOneLiner(update)).toBe( + `Update: npm · up to date · npm latest ${VERSION} · deps ok`, ); }); diff --git a/src/commands/status.update.ts b/src/commands/status.update.ts index 9fd7809989b..0a19870ba41 100644 --- a/src/commands/status.update.ts +++ b/src/commands/status.update.ts @@ -76,6 +76,7 @@ export function formatUpdateOneLiner(update: UpdateCheckResult): string { if (update.registry?.latestVersion) { const cmp = compareSemverStrings(VERSION, update.registry.latestVersion); if (cmp === 0) { + parts.push("up to date"); parts.push(`npm latest ${update.registry.latestVersion}`); } else if (cmp != null && cmp < 0) { parts.push(`npm update ${update.registry.latestVersion}`);