mirror of
https://github.com/stablyai/orca.git
synced 2026-11-14 01:47:24 +00:00
* Remove low-value ACP, hook and renderer test suites * Remove low-value shared automation and agent test cases * Remove low-value packaging and mobile probe test cases --------- Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
28 lines
953 B
TypeScript
28 lines
953 B
TypeScript
import { describe, expect, it } from 'vitest'
|
|
import { extractLeadingEnvAssignments, mergeCommandEnvironment } from './command-environment'
|
|
|
|
describe('command environment assignments', () => {
|
|
it('lets the last assignment override every Windows spelling without mutating the base', () => {
|
|
const base = { PATH: 'old', Path: 'also old', TOKEN: 'old', KEEP: 'keep', ComSpec: 'cmd.exe' }
|
|
const { env } = extractLeadingEnvAssignments([
|
|
'Path=first',
|
|
'PATH=second',
|
|
'Path=last',
|
|
'token=',
|
|
'agent'
|
|
])
|
|
expect(mergeCommandEnvironment(base, env, 'win32')).toEqual({
|
|
PATH: 'last',
|
|
TOKEN: '',
|
|
KEEP: 'keep',
|
|
COMSPEC: 'cmd.exe'
|
|
})
|
|
expect(base.PATH).toBe('old')
|
|
expect(mergeCommandEnvironment({ PATH: 'old' }, { Path: 'new' }, 'linux')).toEqual({
|
|
PATH: 'old',
|
|
Path: 'new'
|
|
})
|
|
expect(mergeCommandEnvironment(undefined, undefined, 'darwin')).toBeUndefined()
|
|
})
|
|
})
|