Files
orca/tests/e2e/terminal-probe-input-sequence.unit.test.ts
T
slashdevcorpseandBrennan Benson 803a442868 test(e2e): harden terminal restart regressions on Windows (#9064)
* test(e2e): harden Windows terminal restart regressions

* test(e2e): cover renderer replacement rejection

* test(e2e): tolerate ESRCH when force-killing the daemon on POSIX

* fix(ci): preserve Windows restart test selection

---------

Co-authored-by: Brennan Benson <79079362+brennanb2025@users.noreply.github.com>
2026-07-17 17:18:36 -07:00

27 lines
1.1 KiB
TypeScript

import { describe, expect, it } from 'vitest'
import {
buildFreshShellProbeInputSequence,
buildSettledShellProbeInputSequence
} from './terminal-probe-input-sequence'
const command = "& 'C:\\node\\node.exe' '-e' 'console.log(1)'\r"
describe('buildFreshShellProbeInputSequence', () => {
it('does not prefix fresh shell probes with interrupt or line-kill bytes', () => {
expect(buildFreshShellProbeInputSequence(command)).toEqual([command])
expect(buildFreshShellProbeInputSequence(command).join('')).not.toContain('\x03')
expect(buildFreshShellProbeInputSequence(command).join('')).not.toContain('\x15')
})
})
describe('buildSettledShellProbeInputSequence', () => {
it('resets PowerShell without sending the POSIX Ctrl+U binding', () => {
expect(buildSettledShellProbeInputSequence(command, 'win32')).toEqual(['\x03', command])
expect(buildSettledShellProbeInputSequence(command, 'win32').join('')).not.toContain('\x15')
})
it.each(['linux', 'darwin'] as const)('preserves the POSIX reset on %s', (platform) => {
expect(buildSettledShellProbeInputSequence(command, platform)).toEqual(['\x03\x15', command])
})
})