chore(vendor): import pi 1.3.0
Imported as a linear vendor commit so forge rebases do not replay the upstream root tree. git-subtree-dir: third_party/pi git-subtree-split: 71023aec1546d6d677a65669c5665c0927ce0dd0
This commit is contained in:
@@ -3,6 +3,7 @@ import { tmpdir } from "os";
|
||||
import { delimiter, join } from "path";
|
||||
import { afterEach, describe, expect, test } from "vitest";
|
||||
import {
|
||||
detectInstallChange,
|
||||
detectInstallMethod,
|
||||
findNodePackageDir,
|
||||
getSelfUpdateCommand,
|
||||
@@ -449,3 +450,15 @@ describe("detectInstallMethod", () => {
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe("detectInstallChange", () => {
|
||||
// Regression test for #10439: a deleted pnpm install must not fall back to a package.json further up.
|
||||
test("reports a removed install instead of reading a package.json further up", () => {
|
||||
tempDir = mkdtempSync(join(tmpdir(), "pi-install-change-"));
|
||||
const installDir = join(tempDir, "global", "hash");
|
||||
mkdirSync(installDir, { recursive: true });
|
||||
writeFileSync(join(tempDir, "package.json"), JSON.stringify({ version: "0.0.1" }));
|
||||
rmSync(installDir, { recursive: true, force: true });
|
||||
expect(detectInstallChange(join(installDir, "package.json"))).toEqual({ kind: "removed" });
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user