fix(test): isolate environment in non-interactive-env hook tests (#822)

- 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
This commit is contained in:
Jeon Suyeol 2026-01-16 00:54:53 +09:00 committed by GitHub
parent 5e44996746
commit c38b078c12
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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(() => {