(env: Record<string, string | undefined>)
| 16 | // silently breaks the "HOME unset" test scenarios. Clearing USERPROFILE |
| 17 | // alongside HOME prevents that auto-population on Windows runners. |
| 18 | function run(env: Record<string, string | undefined>): Record<string, string> { |
| 19 | const result = spawnSync('bash', [BIN], { |
| 20 | env: { PATH: process.env.PATH, USERPROFILE: '', ...env } as Record<string, string>, |
| 21 | encoding: 'utf-8', |
| 22 | }); |
| 23 | if (result.status !== 0) { |
| 24 | throw new Error(`gstack-paths failed (status ${result.status}): ${result.stderr}`); |
| 25 | } |
| 26 | const out: Record<string, string> = {}; |
| 27 | for (const line of result.stdout.split('\n')) { |
| 28 | const eq = line.indexOf('='); |
| 29 | if (eq > 0) out[line.slice(0, eq)] = line.slice(eq + 1); |
| 30 | } |
| 31 | return out; |
| 32 | } |
| 33 | |
| 34 | describe('gstack-paths', () => { |
| 35 | test('GSTACK_HOME wins over CLAUDE_PLUGIN_DATA and HOME', () => { |
no test coverage detected