Files
adnaan a2b5b3b088 feat(i18n): update Chinese translations for notifications and settings
feat(terminal): add shell integration support with OSC 633 parsing

feat(execution): introduce execution limits and types for command management

fix(notifications): refine notification settings and API for better handling

test(execution): add comprehensive tests for execution scheduler and service

test(notifications): enhance tests for notification routing and webhook handling

test(terminal): implement tests for terminal manager and shell process management
2026-09-05 23:28:09 +08:00

28 lines
1.0 KiB
TypeScript

import { describe, expect, it } from 'vitest'
import {
getInteractiveTerminalBackend,
isLongRunningCommand,
} from '@renderer/agent/tools/commandRuntime'
describe('commandRuntime', () => {
it('routes macOS interactive agent sessions away from PTY', () => {
expect(getInteractiveTerminalBackend('darwin')).toBe('pipe')
})
it('keeps PTY backend on non-macOS platforms', () => {
expect(getInteractiveTerminalBackend('linux')).toBe('pty')
expect(getInteractiveTerminalBackend('win32')).toBe('pty')
})
it('detects long-running commands and explicit background requests', () => {
expect(isLongRunningCommand('npm run dev')).toBe(true)
expect(isLongRunningCommand('vite')).toBe(true)
expect(isLongRunningCommand('npm run dev', false)).toBe(false)
expect(isLongRunningCommand('vite build')).toBe(false)
expect(isLongRunningCommand('echo vite')).toBe(false)
expect(isLongRunningCommand('npm test', true)).toBe(true)
expect(isLongRunningCommand('npm test', false)).toBe(false)
})
})