fix(setup): retain explicitly selected ILSpy paths

This commit is contained in:
morluto
2026-10-26 02:32:00 +08:00
parent 14dd18a7fd
commit 82fe820060
2 changed files with 24 additions and 0 deletions
@@ -2,6 +2,7 @@ import type { DoctorProviderInspection } from "./Doctor.js";
import { compareUnicodeCodePoints } from "../domain/unicodeCodePointOrder.js";
const SELECTED_REGISTRATION_SETTINGS = [
"REA_ILSPY_CMD_PATH",
"REA_ANALYSIS_PROVIDER",
"REA_ASAR_MAX_HEADER_BYTES",
"REA_BRIDGE_MAX_REQUEST_BYTES",
+23
View File
@@ -23,6 +23,29 @@ import { snapshotEnvironment } from "./process/snapshotEnvironment.js";
afterEach(() => vi.unstubAllEnvs());
it.each([undefined, "/caller/tools with spaces/ilspycmd"])(
"preserves the explicit ILSpy path %s without inventing an unset value",
async (selected) => {
const host = systemSetupHost(
createDoctorHostFixture({
...(selected === undefined ? {} : { configuredIlspyCmdPath: selected }),
ilspyCmdVersion: async () => "ilspycmd 9.1.0",
}),
selected === undefined ? {} : { REA_ILSPY_CMD_PATH: selected },
);
try {
const state = await host.initialSetupState();
expect(state.providerEnvironment.REA_ILSPY_CMD_PATH).toBe(selected);
if (selected !== undefined)
expect(state.doctor.checks).toContainEqual(
expect.objectContaining({ name: "ilspycmd", ok: true }),
);
} finally {
await host.close?.();
}
},
);
it("plans setup and uninstall against selected home and client overrides", async () => {
const root = await mkdtemp(join(tmpdir(), "rea-selected-setup-"));
const environment = {