Files
orca/src/shared/environment-overlay.test.ts
T
bfa941aa06 fix(native-chat): honor Windows environment overrides consistently (#40301)
* fix(native-chat): apply Windows environment overrides consistently

Use the same case-aware composition for native chat launches, preflight,
model discovery and naming. Canonicalize configured Windows names before
account readers and preserve account pins and POSIX case distinctions.

Tracked in #39075.

Co-authored-by: 김태겸 <oharapass@gmail.com>
Co-authored-by: Vitalii Kulish <mancunianez@gmail.com>

* test(native-chat): cover effective Windows catalog changes

* test(native-chat): retain child environment test import after sync

* test(native-chat): verify Windows child environment precedence

---------

Co-authored-by: 김태겸 <oharapass@gmail.com>
Co-authored-by: Vitalii Kulish <mancunianez@gmail.com>
2026-11-09 12:04:26 -08:00

28 lines
1.0 KiB
TypeScript

import { expect, it } from 'vitest'
import { overlayEnvironmentVariables } from './environment-overlay'
it('replaces Windows aliases in configured order while preserving untouched inherited names', () => {
const base = { TOKEN: 'old', Token: 'also old', PATH: 'first', Path: 'second', KEEP: 'keep' }
const configured = { token: 'first override', tOKEN: '', Custom: 'configured' }
expect(overlayEnvironmentVariables(base, configured, 'win32')).toEqual({
PATH: 'first',
Path: 'second',
KEEP: 'keep',
TOKEN: '',
CUSTOM: 'configured'
})
expect(Object.entries(base)).toEqual([
['TOKEN', 'old'],
['Token', 'also old'],
['PATH', 'first'],
['Path', 'second'],
['KEEP', 'keep']
])
expect(configured).toEqual({ token: 'first override', tOKEN: '', Custom: 'configured' })
expect(overlayEnvironmentVariables(base, undefined, 'win32')).toEqual(base)
expect(overlayEnvironmentVariables({ TOKEN: 'old' }, { token: 'new' }, 'linux')).toEqual({
TOKEN: 'old',
token: 'new'
})
})