|
5 | 5 | import { describe, it, expect, beforeEach, afterEach } from 'vitest' |
6 | 6 | import { mkdtempSync, readFileSync, existsSync, statSync, rmSync, utimesSync, readdirSync } from 'fs' |
7 | 7 | import { tmpdir } from 'os' |
8 | | -import { join } from 'path' |
| 8 | +import { delimiter, join } from 'path' |
9 | 9 | import { |
10 | 10 | installYuHeardWrapper, |
11 | 11 | installYuHeardHook, |
@@ -36,8 +36,10 @@ describe('installYuHeardWrapper', () => { |
36 | 36 | expect(dir).toBe(join(baseDir, 'pn-1')) |
37 | 37 | expect(existsSync(join(dir, 'claude'))).toBe(true) |
38 | 38 | expect(existsSync(join(dir, 'codex'))).toBe(true) |
39 | | - const st = statSync(join(dir, 'claude')) |
40 | | - expect((st.mode & 0o100) !== 0).toBe(true) |
| 39 | + if (process.platform !== 'win32') { |
| 40 | + const st = statSync(join(dir, 'claude')) |
| 41 | + expect((st.mode & 0o100) !== 0).toBe(true) |
| 42 | + } |
41 | 43 | }) |
42 | 44 |
|
43 | 45 | it('embeds the socket path in the hook and does not call yuheard on PATH', () => { |
@@ -188,7 +190,8 @@ describe('pruneYuHeardWrappers', () => { |
188 | 190 |
|
189 | 191 | describe('prependWrapperToPath', () => { |
190 | 192 | it('prepends the wrapper dir to an existing PATH', () => { |
191 | | - expect(prependWrapperToPath('/wrappers/pn-1', '/usr/bin:/bin')).toBe('/wrappers/pn-1:/usr/bin:/bin') |
| 193 | + const current = ['/usr/bin', '/bin'].join(delimiter) |
| 194 | + expect(prependWrapperToPath('/wrappers/pn-1', current)).toBe(['/wrappers/pn-1', '/usr/bin', '/bin'].join(delimiter)) |
192 | 195 | }) |
193 | 196 |
|
194 | 197 | it('handles an empty PATH gracefully', () => { |
|
0 commit comments