From f88d0c42e3de7fa174cc7258ea72f381af3c031d Mon Sep 17 00:00:00 2001 From: Mario Tarosso Date: Mon, 28 Sep 2026 15:38:20 +0100 Subject: [PATCH] Pin the guide tests to a local project for every test The publish job runs on main, where the CLI reads GitHub's own variables as a production build. Three guide tests that expect a local project failed there after passing on the pull request, which reads as sandbox. Co-Authored-By: Claude Opus 5.5 (1M context) --- tests/guide.test.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tests/guide.test.ts b/tests/guide.test.ts index 75434de6..88701e15 100644 --- a/tests/guide.test.ts +++ b/tests/guide.test.ts @@ -27,7 +27,9 @@ describe('guide', () => { delete process.env.PATCHSTACK_SITE_UUID; delete process.env.PATCHSTACK_ENDPOINT; delete process.env.PATCHSTACK_TIMEOUT_MS; - delete process.env.PATCHSTACK_ENVIRONMENT; + // A developer's machine. Without this, a CI runner's own variables decide the environment: a + // pull-request build reads as sandbox and the publish job on main as production. + process.env.PATCHSTACK_ENVIRONMENT = 'local'; }); afterEach(async () => { @@ -229,8 +231,6 @@ describe('guide', () => { }; it('prints the four progress steps in order, with the agreed wording', async () => { - // A developer's machine. Without this, a CI runner's own variables name the environment. - process.env.PATCHSTACK_ENVIRONMENT = 'local'; writeJson('package.json', { name: 'fresh-app' }); const output = renderGuideChecklist(await collectGuideState(cwd), false); @@ -336,8 +336,6 @@ describe('guide', () => { }); it('makes connecting the next step on a wired project, with the claim link', async () => { - // A developer's machine. Without this, a CI runner's own variables name the environment. - process.env.PATCHSTACK_ENVIRONMENT = 'local'; wiredProject(); const output = renderGuideChecklist(await collectGuideState(cwd), false); @@ -645,7 +643,7 @@ describe('guide on a project with no request path', () => { beforeEach(async () => { cwd = await mkdtemp(path.join(tmpdir(), 'patchstack-guide-static-')); delete process.env.PATCHSTACK_SITE_UUID; - delete process.env.PATCHSTACK_ENVIRONMENT; + process.env.PATCHSTACK_ENVIRONMENT = 'local'; }); afterEach(async () => {