feat(tools): extend cancellation to browser, web, and process tools
This commit is contained in:
@@ -154,4 +154,16 @@ describe('Browser tools', () => {
|
||||
expect(result.success).toBe(false);
|
||||
expect(result.error).toContain('Element not found');
|
||||
});
|
||||
|
||||
it('returns aborted error when signal is already aborted', async () => {
|
||||
const tool = tools.find(t => t.name === 'browser.navigate')!;
|
||||
const controller = new AbortController();
|
||||
controller.abort();
|
||||
|
||||
const result = await tool.execute({ url: 'https://example.com' }, { signal: controller.signal });
|
||||
expect(result.success).toBe(false);
|
||||
expect(result.error).toContain('aborted');
|
||||
expect(mockManager.getPage).not.toHaveBeenCalled();
|
||||
expect(mockGoto).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user