From ae9b63e2b226b5408b9429c9c105f83e9a629fd2 Mon Sep 17 00:00:00 2001 From: James Garbutt <43081j@users.noreply.github.com> Date: Thu, 13 Aug 2026 23:27:59 +0100 Subject: [PATCH] test: retain process.env when overriding NETLIFY vars The previous code was nuking the entire `process.env` which meant some built-in tools like `os.tmpdir()` would be `undefined` on Windows (as it depends on `env.TEMP` or some such thing existing). We should be able to safely extend the existing env instead of overwriting it. --- tests/integration/commands/build/build-program.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/commands/build/build-program.test.ts b/tests/integration/commands/build/build-program.test.ts index 5f3c23c994a..a839ccf593e 100644 --- a/tests/integration/commands/build/build-program.test.ts +++ b/tests/integration/commands/build/build-program.test.ts @@ -71,7 +71,7 @@ describe('command/build', () => { // eslint-disable-next-line no-restricted-properties process.cwd = () => builder.directory await withMockApi(routes, async ({ apiUrl }) => { - process.env = getEnvironmentVariables({ apiUrl }) + process.env = { ...originalEnv, ...getEnvironmentVariables({ apiUrl }) } await builder.withNetlifyToml({ config: {} }).withStateFile({ siteId: siteInfo.id }).build()