Merge b940fa74099f77f88dc654cb494f193241e3549e into 598f1826d8b2bc969aace2c6459824737667218c
This commit is contained in:
commit
ddc840fa97
@ -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`,
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@ -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}`);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user