Skip to content

Commit 55da8fb

Browse files
mchwangclaude
andcommitted
Take the fixed gh settings from ghEnvironment in the runner test
#84 now sets GH_PAGER per platform (empty on Windows, cat elsewhere). The test compares against ghEnvironment({}) instead of a hard-coded list, so it follows the helper's own values. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 608295e commit 55da8fb

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎test/gh-env.test.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { GhMergeGateway, type RunGh } from '../github/merge.ts';
66
import { GhIssueGateway } from '../github/issues.ts';
77
import { GhPullRequestGateway } from '../github/pull-requests.ts';
88
import { GhAlreadyFixedGateway } from '../github/already-fixed.ts';
9-
import { GH_ENV_ALLOWLIST } from '../github/gh-env.ts';
9+
import { GH_ENV_ALLOWLIST, ghEnvironment } from '../github/gh-env.ts';
1010

1111
// Every adapter's own runner, not an injected one: these are the runners the server uses.
1212
// Each adapter must send every `gh` call through `run`, or this test does not see it.
@@ -47,7 +47,8 @@ describe('default gh runners', () => {
4747
it.each(defaultRunners)('%s: passes the allowlisted variables and nothing unrelated', async (_name, runner) => {
4848
const lines = (await runner()(['api', 'user'])).split('\n');
4949
for (const [name, value] of Object.entries(expected)) expect(lines).toContain(`${name}=${value}`);
50-
for (const setting of ['GH_PROMPT_DISABLED=1', 'GH_NO_UPDATE_NOTIFIER=1', 'GH_PAGER=cat', 'NO_COLOR=1']) expect(lines).toContain(setting);
50+
// The fixed settings are what ghEnvironment adds to an empty environment on this platform.
51+
for (const [name, value] of Object.entries(ghEnvironment({}))) expect(lines).toContain(`${name}=${value}`);
5152
expect(lines.some(line => line.startsWith('CODEBOOST_UNRELATED_SECRET='))).toBe(false);
5253
});
5354
});

0 commit comments

Comments
 (0)