From 6015fced3cc844ebc63996277b6ca64e7ef6ee4b Mon Sep 17 00:00:00 2001 From: Suyeol Jeon Date: Fri, 16 Jan 2026 00:46:28 +0900 Subject: [PATCH] fix(test): isolate environment in non-interactive-env hook tests - Delete PSModulePath in beforeEach() to prevent CI cross-platform detection - Set SHELL=/bin/bash to ensure tests start with clean Unix-like environment - Fixes flaky test failures on GitHub Actions CI runners - Tests can still override these values for PowerShell-specific behavior --- src/hooks/non-interactive-env/index.test.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/hooks/non-interactive-env/index.test.ts b/src/hooks/non-interactive-env/index.test.ts index 370feee95a..917eef7954 100644 --- a/src/hooks/non-interactive-env/index.test.ts +++ b/src/hooks/non-interactive-env/index.test.ts @@ -13,6 +13,11 @@ describe("non-interactive-env hook", () => { SHELL: process.env.SHELL, PSModulePath: process.env.PSModulePath, } + // #given clean Unix-like environment for all tests + // This prevents CI environments (which may have PSModulePath set) from + // triggering PowerShell detection in tests that expect Unix behavior + delete process.env.PSModulePath + process.env.SHELL = "/bin/bash" }) afterEach(() => {