23 lines
752 B
TypeScript
23 lines
752 B
TypeScript
import { describe, expect, it } from 'vitest'
|
|
import { resolveLocalShell } from '../src/main/session/LocalBackend'
|
|
|
|
describe('local shell selection', () => {
|
|
it('uses ComSpec without Unix login arguments on Windows', () => {
|
|
expect(resolveLocalShell('win32', { ComSpec: 'C:\\Windows\\System32\\cmd.exe' })).toEqual({
|
|
shell: 'C:\\Windows\\System32\\cmd.exe',
|
|
args: [],
|
|
})
|
|
})
|
|
|
|
it('falls back to cmd.exe when ComSpec is unavailable', () => {
|
|
expect(resolveLocalShell('win32', {})).toEqual({ shell: 'cmd.exe', args: [] })
|
|
})
|
|
|
|
it('keeps the login-shell behaviour on Unix platforms', () => {
|
|
expect(resolveLocalShell('linux', { SHELL: '/bin/zsh' })).toEqual({
|
|
shell: '/bin/zsh',
|
|
args: ['-l'],
|
|
})
|
|
})
|
|
})
|