From 85cb8b7450a90768353a585d01274944e1d40587 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 15 May 2026 23:37:10 +0000 Subject: [PATCH] test: isolate doctor env-sensitivity tests from ambient environment PR #109 merged before this fix landed, leaving main red: the new missing-env and missing-host-field assertions in doctor.test.ts read process.env via loadDeploymentEnv, and the self-hosted runner exports GITHUB_PAT, so the expected "missing GITHUB_PAT, ..." detail differed from local. Wrap these cases in withEnv to clear the relevant variables, matching the existing missing-env test pattern. https://claude.ai/code/session_01QxQ71Yrf2Cn6zVfM4LY7AR --- test/doctor.test.ts | 45 ++++++++++++++++++++++++++++++++------------- 1 file changed, 32 insertions(+), 13 deletions(-) diff --git a/test/doctor.test.ts b/test/doctor.test.ts index 106a15a..0e25322 100644 --- a/test/doctor.test.ts +++ b/test/doctor.test.ts @@ -1228,11 +1228,20 @@ pools: "utf8" ); - const report = await runDoctor({ - mode: "synology", - envPath, - configPath: poolsPath - }); + const report = await withEnv( + { + GITHUB_PAT: undefined, + GITHUB_TOKEN: undefined, + GH_TOKEN: undefined, + SYNOLOGY_HOST: undefined + }, + () => + runDoctor({ + mode: "synology", + envPath, + configPath: poolsPath + }) + ); const envCheck = findCheck(report, "synology-env"); expect(envCheck.status).toBe("fail"); @@ -1436,14 +1445,24 @@ pools: "utf8" ); - const report = await runDoctor({ - mode: "windows-docker", - envPath, - windowsConfigPath: windowsPath, - fetchImpl: vi.fn(async () => { - throw new Error("runner-group verification should not run"); - }) - }); + const report = await withEnv( + { + GITHUB_PAT: undefined, + GITHUB_TOKEN: undefined, + GH_TOKEN: undefined, + WINDOWS_DOCKER_HOST: undefined, + WINDOWS_DOCKER_USERNAME: undefined + }, + () => + runDoctor({ + mode: "windows-docker", + envPath, + windowsConfigPath: windowsPath, + fetchImpl: vi.fn(async () => { + throw new Error("runner-group verification should not run"); + }) + }) + ); const configCheck = findCheck(report, "windows-docker-config"); expect(configCheck.status).toBe("fail");