From c2b79aa462af6a7eaff26124f39473417f2a5ff0 Mon Sep 17 00:00:00 2001 From: morluto <76467478+morluto@users.noreply.github.com> Date: Wed, 14 Oct 2026 19:10:22 +0800 Subject: [PATCH] test(doctor): separate Hopper availability and version assertions --- .../cli/doctorHopperDiscovery.test.ts | 28 ++++++++++++------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/tests/boundary/cli/doctorHopperDiscovery.test.ts b/tests/boundary/cli/doctorHopperDiscovery.test.ts index 0e7fdeacb9..1cddbbbb08 100644 --- a/tests/boundary/cli/doctorHopperDiscovery.test.ts +++ b/tests/boundary/cli/doctorHopperDiscovery.test.ts @@ -56,26 +56,34 @@ cliTest.skipIf(!["darwin", "linux"].includes(process.platform))( timeoutMs: 20_000, }); - const executableOnHost = process.platform === "darwin"; + const hopperReady = process.platform === "darwin"; expect(result.signal).toBeNull(); - expect(result.exitCode).toBe(executableOnHost ? 0 : 1); + expect(result.exitCode).toBe(hopperReady ? 0 : 1); expect(result.json).toMatchObject({ - healthy: executableOnHost, + healthy: hopperReady, environment_healthy: false, - ...(executableOnHost ? { hopperPath: launcher } : {}), + ...(hopperReady ? { hopperPath: launcher } : {}), checks: expect.arrayContaining([ expect.objectContaining({ name: "hopper", - ok: executableOnHost, + ok: true, detail: launcher, - classification: executableOnHost ? "healthy" : "config_drift", - ...(executableOnHost - ? {} - : { remediation: expect.stringContaining("HOPPER_LAUNCHER_PATH") }), + classification: "healthy", }), + ...(process.platform === "linux" + ? [ + expect.objectContaining({ + name: "hopper-version", + ok: false, + detail: launcher, + classification: "config_drift", + remediation: expect.stringContaining("HOPPER_LAUNCHER_PATH"), + }), + ] + : []), ]), }); - if (!executableOnHost) expect(result.json).not.toHaveProperty("hopperPath"); + if (!hopperReady) expect(result.json).not.toHaveProperty("hopperPath"); await expect(access(launchMarker)).rejects.toMatchObject({ code: "ENOENT", });