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:
parent
5e44996746
commit
c38b078c12
@ -13,6 +13,11 @@ describe("non-interactive-env hook", () => {
|
|||||||
SHELL: process.env.SHELL,
|
SHELL: process.env.SHELL,
|
||||||
PSModulePath: process.env.PSModulePath,
|
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(() => {
|
afterEach(() => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user