mirror of
https://github.com/stablyai/orca.git
synced 2026-09-27 08:02:35 +00:00
* fix(source-control): keep huge change sets responsive * Fix cancellation and retry handling for capped status * Harden capped status for conflict-heavy repositories * Harden capped status recovery and cancellation * fix(source-control): preserve capped status correctness * fix(source-control): translate submodule status at render time --------- Co-authored-by: Brennan Benson <79079362+brennanb2025@users.noreply.github.com>
33 lines
1.1 KiB
TypeScript
33 lines
1.1 KiB
TypeScript
import * as ChildProcessModule from 'node:child_process'
|
|
import { afterEach, describe, expect, it, vi } from 'vitest'
|
|
|
|
vi.mock('node:child_process', async (importOriginal) => {
|
|
const actual = await importOriginal<typeof ChildProcessModule>()
|
|
return { ...actual, execFile: vi.fn() }
|
|
})
|
|
|
|
import { terminateRelaySubprocessTree } from './subprocess-tree-termination'
|
|
|
|
const originalPlatform = process.platform
|
|
|
|
afterEach(() => {
|
|
Object.defineProperty(process, 'platform', { configurable: true, value: originalPlatform })
|
|
vi.mocked(ChildProcessModule.execFile).mockReset()
|
|
})
|
|
|
|
describe('terminateRelaySubprocessTree', () => {
|
|
it('invokes Windows taskkill without a shell command', () => {
|
|
Object.defineProperty(process, 'platform', { configurable: true, value: 'win32' })
|
|
const child = { pid: 12345, kill: vi.fn() } as unknown as ChildProcessModule.ChildProcess
|
|
|
|
terminateRelaySubprocessTree(child)
|
|
|
|
expect(ChildProcessModule.execFile).toHaveBeenCalledWith(
|
|
'taskkill',
|
|
['/pid', '12345', '/T', '/F'],
|
|
expect.any(Function)
|
|
)
|
|
expect(child.kill).not.toHaveBeenCalled()
|
|
})
|
|
})
|