test: update tests for detached process changes

This commit is contained in:
xuewenjie 2025-12-29 11:37:54 +08:00
parent f610133660
commit 98c043bf50
2 changed files with 1 additions and 28 deletions

View file

@ -960,32 +960,5 @@ spanning multiple lines"`;
{},
);
});
it('should detect immediate failure in Windows background task', async () => {
vi.mocked(os.platform).mockReturnValue('win32');
const mockAbortSignal = new AbortController().signal;
const invocation = shellTool.build({
command: 'invalid_command',
is_background: true,
});
const promise = invocation.execute(mockAbortSignal);
// Wait a tick to ensure mockShellOutputCallback is assigned
await new Promise((resolve) => setTimeout(resolve, 0));
if (mockShellOutputCallback) {
mockShellOutputCallback({
type: 'data',
chunk:
"'invalid_command' is not recognized as an internal or external command,\r\noperable program or batch file.\r\n",
});
}
const result = await promise;
expect(result.error).toBeDefined();
expect(result.llmContent).toContain('Command failed to start');
});
});
});