fix(update): accept npm 12 release metadata (#1138)

* fix(update): accept npm 12 release metadata

(cherry picked from commit aa400d18c95e36029c5c654c396ec66924e1358f)

* fix(update): classify npm release metadata without a spawn mock

Keep the npm 11 string and npm 12 one-element array accepted by the
cherry-picked lookup, and separate invalid metadata from a failed
registry command.

---------

Co-authored-by: Dapo Olaomo <penielgold@gmail.com>
This commit is contained in:
morluto
2026-10-09 06:29:29 +08:00
committed by GitHub
co-authored by Dapo Olaomo
parent 82626c4499
commit 567a82f8d4
5 changed files with 215 additions and 31 deletions
+4 -1
View File
@@ -88,7 +88,10 @@ describe("CLI command outcome classification", () => {
};
const updateHost: UpdateHost = {
installation: () => Promise.resolve(installation),
latestVersion: () => Promise.resolve(err("registry unavailable")),
latestVersion: () =>
Promise.resolve(
err({ kind: "unavailable", detail: "registry unavailable" }),
),
installVersion: () => Promise.resolve(err("not called")),
installedVersion: () => Promise.resolve(err("not called")),
planMaintenance: () =>