fix(coding-agent): install checked pi update version

This commit is contained in:
Armin Ronacher
2026-06-21 14:46:07 +02:00
parent d93b92baca
commit bc0db64350
5 changed files with 105 additions and 42 deletions
+23
View File
@@ -188,6 +188,29 @@ describe("detectInstallMethod", () => {
});
});
test("self-updates exact npm versions without uninstalling the current package", () => {
const { prefix } = createNpmPrefixInstall();
const command = getSelfUpdateCommand("@earendil-works/pi-coding-agent", undefined, {
packageName: "@earendil-works/pi-coding-agent",
installSpec: "@earendil-works/pi-coding-agent@1.2.3",
});
expect(command).toEqual({
command: "npm",
args: [
"--prefix",
prefix,
"install",
"-g",
"--ignore-scripts",
"--min-release-age=0",
"@earendil-works/pi-coding-agent@1.2.3",
],
display: `npm --prefix ${prefix} install -g --ignore-scripts --min-release-age=0 @earendil-works/pi-coding-agent@1.2.3`,
});
});
test("self-updates renamed packages from the current install prefix", () => {
const { prefix } = createNpmPrefixInstall();