File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
test/core/completions/installers Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -37,4 +37,7 @@ release:
3737 $(PNPM ) run release:local
3838
3939test :
40- $(PNPM ) test
40+ $(PNPM ) test
41+
42+ lint :
43+ $(PNPM ) lint
Original file line number Diff line number Diff line change @@ -8,15 +8,27 @@ import { ZshInstaller } from '../../../../src/core/completions/installers/zsh-in
88describe ( 'ZshInstaller' , ( ) => {
99 let testHomeDir : string ;
1010 let installer : ZshInstaller ;
11+ let originalZshEnv : string | undefined ;
1112
1213 beforeEach ( async ( ) => {
14+ // Save and clear ZSH environment variable to avoid interference with tests
15+ originalZshEnv = process . env . ZSH ;
16+ delete process . env . ZSH ;
17+
1318 // Create a temporary home directory for testing
1419 testHomeDir = path . join ( os . tmpdir ( ) , `openspec-zsh-test-${ randomUUID ( ) } ` ) ;
1520 await fs . mkdir ( testHomeDir , { recursive : true } ) ;
1621 installer = new ZshInstaller ( testHomeDir ) ;
1722 } ) ;
1823
1924 afterEach ( async ( ) => {
25+ // Restore ZSH environment variable
26+ if ( originalZshEnv !== undefined ) {
27+ process . env . ZSH = originalZshEnv ;
28+ } else {
29+ delete process . env . ZSH ;
30+ }
31+
2032 // Clean up test directory
2133 await fs . rm ( testHomeDir , { recursive : true , force : true } ) ;
2234 } ) ;
You can’t perform that action at this time.
0 commit comments